Jump to:

7940 Posts in 1543 Topics by 946 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, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 693 Views
  • bod
    Avatar
    Community Member
    72 Posts

    ImageGallery single level view not working Link to this post

    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?

  • bod
    Avatar
    Community Member
    72 Posts

    Re: ImageGallery single level view not working Link to this post

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

  • bod
    Avatar
    Community Member
    72 Posts

    Re: ImageGallery single level view not working Link to this post

    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>

  • bod
    Avatar
    Community Member
    72 Posts

    Re: ImageGallery single level view not working Link to this post

    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.

    693 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.