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:

General Questions /

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

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

Sub Menus

Go to End

5 Posts   1090 Views


Community Member, 1 Post

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?




Community Member, 283 Posts

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 %>


Community Member, 904 Posts

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.


Community Member, 102 Posts

19 November 2009 at 10:30pm


try to control your levels which returns the current section you are in.
its scope is limited as compared to Menu which is global



Community Member, 283 Posts

20 November 2009 at 4:32pm

Ahhh, yeah overlooked that with Menu(). Those guys are smart (and righter)