Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Including gallery items in a different page template


Reply

5 Posts   1844 Views

Avatar
bird

27 November 2009 at 2:55pm (Last edited: 3 December 2009 2:14am), Community Member, 9 Posts

Hi!

I would like to include gallery images / items from a specific gallery page in another page's template.
Using something like: <% control Page(mygallerypage) %>$Content<% end_control %> doesen't work because this can only be used for the static content / text but not for the dynamic gallery images.

How could I include those images in a different template anyway?

Best regards
bird

Avatar
patjnr

30 November 2009 at 8:27pm Community Member, 101 Posts

A you trying to add more than 1 gallery pages on you site or you only want to use the images. ???

Avatar
bird

30 November 2009 at 8:56pm (Last edited: 3 December 2009 2:15am), Community Member, 9 Posts

I would like to call those images in another template.
willr (my hero) gave me the code in the IRC channel. Maybe this might be helpful for other users, too:

Calling gallery page items in another template:

<% control Page(your_gallerypage) %>
<% if GalleryItems %>
<% control GalleryItems %>
<a id="ViewLink-$ID" class="$JSLightWindow"<% if JSMedia %> rel="$JSMedia"<% end_if %> href="$ViewLink" title="$Title">
<img src="$ThumbnailURL" alt="$Title"/>
</a>
<% end_control %>
<% else %>
No Images
<% end_if %>
<% end_control %>

You have to check that all the corresponding JS and CSS files (e. g. for lightbox) are called correctly in you template.
The only thing I'm struggling with so far is the multi language use of this feature...

Avatar
Lamin Barrow

17 December 2009 at 7:44am Community Member, 21 Posts

Enter this code

$RecentImagesGallery(10)   

in any page template file. This will pull the latest 10 images from your image gallery.

Avatar
Lamin Barrow

17 December 2009 at 7:44am Community Member, 21 Posts

Enter this code

$RecentImagesGallery(10)   

in any page template file. This will pull the latest 10 images from your image gallery.