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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

ImageGallery Display All Albums and All Images on one page


Reply


2 Posts   1113 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, 4096 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 %>