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.

Archive /

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

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

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


Reply


8 Posts   1984 Views

Avatar
Nicolaas

Forum Moderator, 213 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

Nicolaas

Avatar
Mattosch

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!

Mattosch

Avatar
SilverRay

Community Member, 167 Posts

10 December 2007 at 2:30pm

Edited: 10/12/2007 2:31pm

Nicolaas,

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

http://www.silverstripe.com/site-builders-forum/flat/13932

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!

Avatar
Fuzz10

Community Member, 787 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 ....

Avatar
dio5

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.

Avatar
Fuzz10

Community Member, 787 Posts

11 December 2007 at 10:31pm

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

Thanks !

Avatar
dio5

Community Member, 501 Posts

11 December 2007 at 11:53pm

http://doc.silverstripe.com/doku.php?id=security#cms_author_access
:-)

Avatar
Fuzz10

Community Member, 787 Posts

12 December 2007 at 12:04am

heheh...

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

Thanks anyway !