I have a masonry type image grid layout and I need to specify a different image transform for just the 2nd and fourth images in this grid.
Does the image ID relate to the order or to the specific image? How could I include a conditional in my code to output the largeIndexHalf image transform for the 2nd and 4th image?
{% set asset = entry.portraits %}
{% if asset | length %}
{% for asset in entry.portraits %}
<div class="item"><img src="{{ asset.getUrl('largeIndex') }}" /></div>
{% endfor %}
{% endif %}