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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

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

Availability of entire page tree


Go to End


3 Posts   2520 Views

Avatar
gaston

Community Member, 26 Posts

17 April 2009 at 7:03pm

Salut,

is there a way to have access to the full page tree?
The idea is to create a more complex menu with dropline style. For that I need to know the entire menu structure so that I can feed all links to subpages into the menu structure.
In my curernt understanding, only the subtree of the current page is available

Ciao, Mathias

Avatar
Willr

Forum Moderator, 5523 Posts

18 April 2009 at 6:52pm

No, you have full availability from any page. To generate a menu on a page you can do something like

<% control Menu(1) %>
  // level 1
<% control Children %>
  // level 2
<% control Children %>
  // level 3
.....
<% end_control %>
<% end_control %>
<% end_control %>

If you want to dynamically get the levels (rather then hardcoding 4 control Children have a look at the sitemap tutorial - http://doc.silverstripe.com/doku.php?id=tutorial:site-map

Avatar
gaston

Community Member, 26 Posts

19 April 2009 at 4:48am

Edited: 19/04/2009 4:49am

Salut,

thanks, I got the logic and it works. I got a very nice drop-line menu that I will incorporate into a theme. I now need to iron out the pixels and test it with different browsers, but it will soon be published.
I also looked at the solution with the site-map example. This works as well but themes do not deliver php files ...

Ciao, Mathias