Hi,
I'm iterating through pages in a collection and I want to select from each post, one image and one gif we can find on each folder.
{% for p in page.collection %}
{% set first_image = p.media.images|first %}
{% set first_gif = p.media['avatar.gif'] %}
<h2>{{ p.title }}</h2>
<h3>{{ p.header.headline }}</h3>
{{ first_image }}
{{ first_gif }}
{{ p.summary }}
{% endfor %}
It works with the previous example, but I want to somehow be able to select just one gif image, doesn't matter what's the name of it, like I do with images.
I tried with p.media['*.gif'], p.media['*.gif']|first and p.media.animatedImage|first, but nothing, the only way I found yet to select the gifs per page, is by calling it with the exact name of the file, but this is very restrictive for me.
Could you somehow explain a way to have an array with all the "Animated Image" on each page as we do with the images?
Thanks in advance.