Blog Sections Open
Showing the First EvoGallery Image on a Listing Card
When EvoGallery stores multiple images per resource, listing templates often need just one representative picture. The original question behind this article was how to output the first image only, not the whole gallery.
When EvoGallery stores multiple images per resource, listing templates often need just one representative picture. The original question behind this article was how to output the first image only, not the whole gallery.
Typical Pattern
[[EvoGallery?
&display=`single`
&docId=`[+id+]`
&id=`[+id+]`
&picId=`1`
&itemTpl=`product-image`
]]
This works because display=single tells EvoGallery to return one image, while picId=1 points to the first gallery item for the resource.
Where It Helps
- catalog cards
- news or portfolio previews
- related item blocks
- homepage feature sections
Practical Advice
Keep the gallery logic out of the main listing template. Use a dedicated item template such as product-image so you can change image markup later without touching the catalog loop.
If your project stores a cover image separately, use that instead. But when EvoGallery is the source of truth, a single-image call like this is the simplest clean solution.
Using @CHUNK Bindings in DropDown TVs for Country Lists
How to populate a DropDown List TV from a chunk and when this pattern is useful for long country or region selectors.
Combining Multiple TV Filters in Ditto
How to think about OR-style TV filters in Ditto when one parameter is not enough and output should match several TV values.