title: if condition in for loop in twig template engine
body: <p>Every company object is with a one-to-many relation with image.<br>
  Now in my template I want to check if there is an image of type testtype.  </p>
  
  <p>How to handle this with twig? The following gives me an exception:</p>
  
  <blockquote>
    <p>Unexpected token "string" of value "testtype" ("name" expected)</p>
  </blockquote>
  
  <p>Twig</p>
  
  <pre><code>{% for image in company.images if image.type is 'testtype' %}
  {% endfor %}
  </code></pre>