Hot answers tagged

3

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 block.video.videoFileWebm|length %} // Retrieve the first and only item in the asset field <source src="{{ ...


2

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