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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Multiple Lightbox Galleries - Break through loop to get Gallery Title


3 Posts   374 Views


1 August 2013 at 2:31am Community Member, 37 Posts

Hi there,

I'm trying to set up multiple Lightbox Galleries.

That's my Page/Dataobject construct: Page -> GalleryObject -> ImageObject
That's my Markup:

<% loop Galleries %>
   <% loop Images %>
      <a href="$Image.Url" data-lightbox="$Top.Title">$Image.CroppedImage(46,46)</a>
   <% end_loop %>
<% end_loop %>

The Problem is that each gallery needs an unique title that's specified in the html markup, so that the Lightbox script knows which images belong together.

I tried to use the $Title Value stored in each GalleryObject. But I can't break the ImageObject Loop, so $Top.Title and $Up.Title doesn't server anything :/

Can someone help me to solve this problem?

Thx in advance



6 August 2013 at 10:57pm Community Member, 37 Posts



7 August 2013 at 12:41am Community Member, 189 Posts

$Up.Title should work, very odd. If you were to try $Up.ID does that return anything?