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


Reply


3 Posts   425 Views

Avatar
cSGermany

Community Member, 37 Posts

1 August 2013 at 2:31am

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

cSGermany

Avatar
cSGermany

Community Member, 37 Posts

6 August 2013 at 10:57pm

push!

Avatar
copernican

Community Member, 189 Posts

7 August 2013 at 12:41am

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