Hot answers tagged


Asset fields return like an array so they can potentially have more than one item, you need to request the first item only with .one() (as opposed to requesting .all()) //First check if the asset field has more than zero items {% if|length %} // Retrieve the first and only item in the asset field <source src="{{ ...


In Craft 3 this should be: {% if entry.images | length > 1 %} {% set secondImage = entry.images.1 %} {% endif %}

Only top voted, non community-wiki answers of a minimum length are eligible