Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » How do you display Thumbnails in GalleryHolder?

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

Page: 1
Go to End
Author Topic: 1254 Views
  • fostahgix
    Avatar
    Community Member
    9 Posts

    How do you display Thumbnails in GalleryHolder? Link to this post

    Hey all,

    I found a thread ( http://www.silverstripe.org/archive/show/126874#post126874 ) which talks about displaying thumbnails in GalleryHolder.php(displaying thumbs is easy in GalleryPage, however the issue is I cannot find the gallery items within the children control of the GalleryHolder.php).

    Here is the example that is demonstrated in the other thread:

    <% control children %>
    <a href="$Link">$Title</a>
    <% control CurrentGalleryItems %>

    <!-- Template stuff, copied from GalleryPageContent.ss to display the images -->

    <% end_control %>
    <a href="$Link">go to gallery &gt;&gt;</a>
    <% end_control %>

    When i do this i'm not getting any data passed to my <% control CurrentGalleryItems %>. I did an <% if CurrentGalleryItems %> and it never returns true..am I missing something to send current gallery items?

    Here is my current GalleryHolder.ss file

    <% control Children %>
       <% control CurrentGalleryItems %>
          <img src="$ThumbnailURL" alt="$Title"/>
       <% end_control %>

             <div id="$URLSegment" class="articleHolder" style="">
                <div><a href="$URLSegment">$Title</a></div>
                <p class="articleCopy">$Content</p><% include GalleryPageContent %>
             </div>
             
    <% end_control %>

    However, CurrentGalleryItems is not returning any data even though if they gallery is working..am I missing something? Thanks!

  • fostahgix
    Avatar
    Community Member
    9 Posts

    Re: How do you display Thumbnails in GalleryHolder? Link to this post

    Well I found a way to get it working setting a limit

    <% control GalleryItems(10) %>

    instead of <% control CurrentGalleryItems %> and it works now! I'm not sure if this is the best way to list items from the gallery but it works!

    1254 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.