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

[SOLVED] ImageGallery - Get the album names on Page.ss


Reply

4 Posts   1216 Views

Avatar
Raphael--

28 May 2009 at 4:56am (Last edited: 28 May 2009 5:24am), Community Member, 14 Posts

Hi all,

I just would like to display the album names of each ImageGalleryPage in my main menu, to get a menu like that :

. Home
. MyGalleryPage A
-- Album 1
-- Album 2
. MyGalleryPage B
-- Album 1
-- Album 2
-- Album 3

It should be a general question about SilverStripe and oop but I spent hours on my issue and I can't figure it out..
(And yes, I'm still a young beginner on SilverStripe and oop but I can't wait to help the community, when I will be proficient enough.. !)

Thanks for your help.

Avatar
UncleCheese

28 May 2009 at 5:14am 4085 Posts

I'm not sure how your site tree is set up. If all you have are gallery pages, you can pretty much just add it into your Menu control.

<% control Menu(1) %>
$Title
<% if ClassName = ImageGalleryPage %>
<% control Albums %>
$AlbumName
<% end_control %>
<% end_if %>
<% end_control %>

You get the idea...

Avatar
Raphael--

28 May 2009 at 5:23am Community Member, 14 Posts

And it works ! That's absolutely brilliant ! I'm so impressed by Silverstripe..

Thanks again UncleCheese.

Avatar
sdbruder

5 December 2009 at 10:03am (Last edited: 5 December 2009 10:04am), Community Member, 4 Posts

Any ideia when my site IS NOT only gallery pages?
EDIT: Forget it, now Ive saw the <% if class= .... in your example :p