7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » ImageGallery single level view not working
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 554 Views |
-
ImageGallery single level view not working

10 November 2010 at 5:08am
Hi
Have been customising the ImageGallery module for a one page site so that you do not click through to individual albums, instead both the album covers and a link with View Slideshow appears in a ul list.
Once the View Slideshow link is clicked, the lightbox launches for that album. My problem is I can’t seem to get the $GalleryItem to appear in the ImageGalleryPage.ss template. What am I missing?
-
Re: ImageGallery single level view not working

10 November 2010 at 5:41am
To expand a bit more it seems that the $GalleryItem cannot live inside the Albums control, a scope/casting issue?? :o/
example code
<% control Albums %>
<li>
<% if CoverImage %>
<% control FormattedCoverImage %>
<img src="$URL" alt="" />
<% end_control %>
<% else %>
<span class="no-image"></span>
<% end_if %>
<div class="galleryDetails">
<h4>$AlbumName</h4>
<p>$Description</p>
<ul>
<% control GalleryItems %>
<li>$GalleryItem</li>
<% end_control %>
</ul></div>
</li>
<% end_control %> -
Re: ImageGallery single level view not working

10 November 2010 at 12:48pm Last edited: 10 November 2010 12:49pm
Update:
After a day of this, I’ve managed to get the lightbox working for each Album listed on the one page using the code below which I’ve posted so someone else might benefit in the same position.
-Still one outstanding problem though - Lightbox is counting all images regardless of which album they are in so launching the first albums lightbox gives 1 of 17 images (first album actually contains 9 images) launching the second album lightbox gives 9 of 17 (contains 8 actual images)
<ul>
<% control Albums %>
<li>
<figure>
<% if CoverImage %>
<% control FormattedCoverImage %>
<img src="$URL" alt="Image of $AlbumName website" />
<% end_control %>
<% else %>
<span class="no-image"></span>
<% end_if %>
<figcaption>
<h3>$AlbumName</h3>
<p> $Description</p>
<p class="further-reading">
<% control GalleryItems %>
<% if First %>
<a rel="lightbox" class="lightbox" title="$Caption.EscapeXML" href="$Large.URL">View Slideshow »»</a>
<% else %>
<a rel="lightbox" class="lightbox" title="$Caption.EscapeXML" href="$Large.URL"></a>
<% end_if %>
<% end_control %>
</p>
</figcaption>
</figure>
</li>
<% end_control %>
</ul> -
Re: ImageGallery single level view not working

11 November 2010 at 3:59am
In answer to my last problem, found the solution:
Use http://www.digitalia.be/software/slimbox2
far better and smaller too, great api.
This forum seems to be very quiet these days, God help you if you’re stuck on something. Hope the code and self answered posts help someone in any case.
| 554 Views | ||
|
Page:
1
|
Go to Top |

