title: Twig - ternary conditional operator
body: <p>it's gonna sound very stupid but I don't know how to write this ternary condition within my twig template.</p>
  
  <pre><code> {% for post in posts %}
     &lt;div class="news_text {{ loop.index is odd ? left : right }}"&gt;
       {{ post.content }}
     &lt;/div&gt;
   {% endfor %}
  </code></pre>
  
  <p>Can anyone tell me what would be the good syntax pls? :-)</p>