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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

menu with special level 1 headings - help me think through this one....

Go to End

8 Posts   2232 Views


Forum Moderator, 224 Posts

19 September 2007 at 2:34pm

Edited: 19/09/2007 4:30pm

Hi Folk

I have a multi-tier menu, where the tier-1 menu headings (e.g. about us, products etc...) will never change. Furthermore, they have images rather than just words for their headings and each one of them is a different size. Now, my question is ... how should I write my .ss template.

** Option 1 **
I could, of course hardwire the tier-1 items and then in the code have something like:
<% control ChildrenOf(about-us) %> [create about us sub menu here]
<% control ChildrenOf(products) %> [create products sub menu here]

** Option 2 **
I could assign an individual ID / class to each tier-1 entry.

** Option 3 **

Should I perhaps add an extra database field that can be used to specifically give the tier-1 pages a code?

The second option seems easier. However, what name or id should I use. I am a bit worried that my CMS administrator might accidentally change the name for one of the pages and thereby destroy the menu. Is there a best practice for this?

What option would you recommend and are there any examples out there?

Thanks in advance



Community Member, 1 Post

10 December 2007 at 4:48am

Hi Nicolaas,

which option(s) did you implement?
Can you give a recommendation?
I'm looking for a solution for using graphical menu-items in tier-1.

Thanks a lot!



Community Member, 167 Posts

10 December 2007 at 2:30pm

Edited: 10/12/2007 2:31pm


With option 1, you helped me further towards a possible solution for a problem I asked a question about in this thread:

But of course, when an author changes the url of a main nav item, the thing breaks... nevertheless it helps me for the time being, thanks!


Community Member, 791 Posts

11 December 2007 at 3:48am

Following up on this , what do you guys think about an option to limit the rights a user has per menu-item ?

Sometimes , I don't want a user to change or delete a menu-entry at all because I need it to be there (in order for my code to run properly). It always run into these problems , with every CMS.

I know this can be done on a per site basis, but I think this might be a really useful feature to add ....


Community Member, 501 Posts

11 December 2007 at 4:38am

Edited: 11/12/2007 4:39am

Fuzz10, I'm doing something similar with what I'm building now.

I' ve created new groups that I give different permissions.

Based on permissions and page-types I either return true or false on the Page class canEdit, canDelete, canCreate and canAddChildren methods.

Don't know if that is the right way to go, but it seems to work for me.


Community Member, 791 Posts

11 December 2007 at 10:31pm

Hey, that is brilliant ! I didn't even find those methods in the docs.

Thanks !


Community Member, 501 Posts

11 December 2007 at 11:53pm


Community Member, 791 Posts

12 December 2007 at 12:04am


I meant before you mentioned them (I'm not _that_ bad at searching) .. ;-)

Thanks anyway !