Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ImageGallery Display All Albums and All Images on one page

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: 1049 Views
  • jameswwright
    Avatar
    Community Member
    1 Post

    ImageGallery Display All Albums and All Images on one page Link to this post

    Is there away to display the data like the following?

    Album 1 Title

    Album 1 Description

    <<Album 1 Image 1>>
    <<Album 1 Image 2>>
    <<Album 1 Image 3>>

    Album 2 Title

    Album 2 Description

    <<Album 2 Image 1>>
    <<Album 2 Image 2>>
    <<Album 2 Image 3>>

    ect...

    I was thinking something like this:

    <% control Albums %>
    <h3>$AlbumName</h3>
    <p>$Description</p>
    //Some sort of logic to display the child images for each album
    <% end_control %>

    I hope that makes sense. Thanks in advance. This is an awesome addition to SilverStripe by the way.

    Cheers,
    Jim

  • UncleCheese
    Avatar
    4085 Posts

    Re: ImageGallery Display All Albums and All Images on one page Link to this post

    You should be able to do this..

    <% control Albums %>
    $AlbumName
    $Description
    <ul>
    <% control GalleryItems %>
    $GalleryItem
    <% end_control %>
    </ul>
    <% end_control %>

    But I doubt that will work because each item needs to have its UI set. This is one of the many reasons ImageGallery needs to be re-architected. That should be very easy to do.

    Right now it looks like the only way to do it is to write the markup and include the UI yourself.

    <% require javascript(path/to/some/ui.js) %>
    <% require css(path/to/some/ui.css) %>

    <% control Albums %>
    $AlbumName
    $Description
    <ul>
    <% control GalleryItems %>
    <li><a rel="some_ui" href="$Large.URL">$Thumb.URL</a></li>
    <% end_control %>
    </ul>
    <% end_control %>

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