Select an image to use as primary thumbnail for gallery

Hi,

I have several Resources that are Galleries as children of a parent Resource. Each child Gallery is represented in the parent resource by a single thumbnail. This thumbnail, by default, is the first image on the Gallery Resource. I would like to be able to specify any image to be the thumbnail that is used to represent the Gallery.

My snippet call on the Parent is

[[!mgGetImages?
&resource=`[[+id]]`
&imageTpl=`albumGalleryImage`
&limit=`1`
&getResourceFields=`1`
]]

The albumGalleryImageTpl is

<div class="image">
<a href="[[~[[+resource]]]]"><img src="[[+file_url:phpthumbsup=`w=400&h=400&zc=1`]]" alt="[[+resource.pagetitle]]" title="[[+resource.pagetitle]]" />
<div class="gallery-title"><h4>[[+resource.pagetitle]]</h4></div></a>
</div>

I thought it might be possible to tag an image, and then use &where to select the image with that tag to be the thumbnail used on the parent page, and attempted the following, but it has not worked. See below - lines 2 and 5:

[[!mgGetImages?
&tagsFromUrl=`tag`
&resource=`[[+id]]`
&imageTpl=`albumGalleryImage`
&where=`{"tag:=":"gallerythumbnail"}`
&limit=`1`
&getResourceFields=`1`
]]

Does anyone have any advice as to how I could get this to happen please?

Andy

Use the &tags property to filter on a tag.

&tags=`gallerythumbnail`
1 Like

Thank you @mhamstra . That has worked perfectly.