title: Twig - add attribut to curent element
body: <p>I'm using Symfony2 Framework with twig to generate my template.</p>
  
  <p>I'm trying to show differents images in a carousel (plugging Jquery) and I put an image zoom (other plugin jquery) on each images.</p>
  
  <p>I'm generating my image from a yaml file.</p>
  
  <pre><code>&lt;ul class="bxslider"&gt;
      {% for datas, values in values['themes'] if datas == category %}
          {% for value, key in values %}
              &lt;li&gt;
  
                  &lt;img src="{{ asset(key.urllow) }}" class="photo-diapo" id="{{ value }}" data-zoom-image="{{ asset(key.url) }}"/&gt;
  
                  &lt;div class="addthis_sharing_toolbox"&gt;&lt;/div&gt;
  
                  &lt;h3 class="photo-titre"&gt;{{ key.titre }}&lt;/h3&gt;
                  &lt;h4 class="photo-date"&gt;{{ key.date }}&lt;/h4&gt;
                  &lt;p class="photo-description"&gt;{{ key.description }}&lt;/p&gt;
  
              &lt;/li&gt;
          {% endfor %}
      {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>My question is for the image attribut data-zoom-image.
  Is there a way to add this attribut with twig only if the image is the curent image on screen ? </p>
  
  <p>Like a {% if ... %} data-zoom-image {% endif %} with a special condition ?</p>
  
  <p>Thanks</p>