17691 Posts in 4607 Topics by 2180 members
General Questions
SilverStripe Forums » General Questions » Unexpected behavior from Menu() in templates
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 824 Views |
-
Unexpected behavior from Menu() in templates

20 August 2009 at 8:12am Last edited: 20 August 2009 9:02am
I'm using Menu(3) in my templates to display local navigation, and I'm getting several menus rendered on a single page. That's not exactly what I was expecting, and I can't figure out what's happening from looking at the docs.
My site is broken up into five main sections, each section has several sub-categories, and all my content lives in those categories. I'm three levels down in the tree, so I use Menu(3) navigation within a given section. What I get is the correct navigation menu for the page I'm looking at, plus the menus for siblings of the category I'm in. Is this normal behavior for Menu(), or have I done something horribly wrong?
For example, if my tree looks like this...
+Products
|+ Widgets
|-+ Airplane widgets
|--- airwidget1
|--- airwidget2
|-+ Submarine widgets
|--- subwidget1
|--- subwidget2
|+ Doodads
|+ Sprockets
+Services
|+Psychic consultation
|+Rocket surgery...then when I'm in the Airplane Widgets section I get the proper menu for that section, but I also get the menu for the Submarine Widgets section.
-
Re: Unexpected behavior from Menu() in templates

21 August 2009 at 4:51am
Fixed!
I never did get Menu() working the way I thought it should. I just realized that I could get the results I wanted using <% control Level(3) %> instead of <% control Menu(3) %>.
| 824 Views | ||
|
Page:
1
|
Go to Top |

