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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Several menu's


Reply

3 Posts   787 Views

Avatar
raamklaza

25 June 2009 at 8:26am Community Member, 182 Posts

Hello,

how can i make several menu's?

For example:
One top menu in a horizontal bar AND one the bottom of the page...

When i make a page i would love to have the option to select the menu this page should show up.

Can some help me out with this?

Avatar
CDGIDev

26 June 2009 at 2:35am Community Member, 9 Posts

It's not possible in itself to have 2 menus in SS but with a little tweaking and organization it can be done. First you need to setup your site to have a "Menus" node. Hide that node so it doesn't show in MENU(1).

Then, create a "TopMenu" and "LeftMenu" page under that. Now all items under those menus will be the pages to appear under those menus. So you could have:

SiteContent
- Menus
- - TopMenu
- - - Item1
- - - Item2
- - - Item3
- - - Item4
- - LeftMenu
- - - Item1
- - - Item2

This will create a structure for later, now the template:

In your template, you'd have to do this:

control Page('LeftMenu')
control Children
<a href="">...</a>
end_control
end_control

This portion will load the page "LeftMenu" and you can easily do it for "TopMenu" too. Then using a control Children, you can loop all the children items.

Was that clear?

Avatar
raamklaza

26 June 2009 at 3:13am Community Member, 182 Posts

That's really clear....

I will come back to you on that, when i am tweaking the design!

Thanx man.

P.s this could be in SS itself obviously.