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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

ImageGallery single level view not working


Go to End


4 Posts   1013 Views

Avatar
bod

Community Member, 72 Posts

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?

Avatar
bod

Community Member, 72 Posts

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 %>

Avatar
bod

Community Member, 72 Posts

10 November 2010 at 12:48pm

Edited: 10/11/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 &raquo;&raquo;</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>

Avatar
bod

Community Member, 72 Posts

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.