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 Display All Albums and All Images on one page


Go to End


2 Posts   1451 Views

Avatar
jameswwright

Community Member, 1 Post

20 January 2010 at 2:41pm

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

20 January 2010 at 3:36pm

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