21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 622 Views |
-
Sub Menus

19 November 2009 at 12:33am
Hi Everyone
I have a template that has a sub page type, which has a menu which is on level 3. this menu in the design is within a separate div tag what <%%> controls would I need to wrap around this to get it only to display the child objects of the parent which is a level 2 page?
Cheers
Justin
-
Re: Sub Menus

19 November 2009 at 3:14pm
Hmmm this is a hierarchy fun-time problem. You need to traverse up to the parent and get it's menus
<% control Parent %>
<% control Menu(1) %><% end_control %>
<% end_control %> -
Re: Sub Menus

19 November 2009 at 8:33pm
I think it should rather be
<% control Parent %><!-- move scope to parent -->
<% control Children %><!-- iterate over parents children --><% end_control %>
<% end_control %>Menu(1), Menu(2) etc. are global. No matter where you call them, they always return the first, second etc. level of pages.
-
Re: Sub Menus

19 November 2009 at 10:30pm
reference http://doc.silverstripe.org/doku.php?id=built-in-page-controls&s=page%20controls
try to control your levels which returns the current section you are in.
its scope is limited as compared to Menu which is globalta
-
Re: Sub Menus

20 November 2009 at 4:32pm
Ahhh, yeah overlooked that with Menu(). Those guys are smart (and righter)
| 622 Views | ||
|
Page:
1
|
Go to Top |




