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.

Archive /

Our old forums are still available as a read-only archive.

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

How to create a menu with only sibling pages listed.


Go to End


4 Posts   3420 Views

Avatar
sjbmaine

Community Member, 17 Posts

18 September 2008 at 1:18pm

I have three levels of pages in my site. Level 1 and 2 appear in one menu. I need to create another menu that shows all of the pages in level three only -- on a level three page. So I need to show all of the sibling pages, but nothing else.

This is my first site with this tool (which I think is just so wonderfully fun) so if you have time to share the actual code, that would be great!

Thanks so much for you help and SilverStripe.

Sophie

Avatar
Phalkunz

Community Member, 69 Posts

18 September 2008 at 4:29pm

It's always good to through these:

Tutorial: http://doc.silverstripe.com/doku.php?id=tutorials
Built-in Page control (template): http://doc.silverstripe.com/doku.php?id=built-in-page-controls

Avatar
grilldan

Community Member, 135 Posts

18 September 2008 at 5:35pm

I think you could do something like:

<% control Children %>
<% control Children %>
<% control Children %>

This is the 3rd level.

<% end_control %>
<% end_control %>
<% end_control %>

If you wanted it only for a specific page, you could add an <% if Page(the_page) %> statement.

Hopefully this will help you a little bit :)

Avatar
sjbmaine

Community Member, 17 Posts

18 September 2008 at 11:54pm

Thank you all! I did figure it out from the tutorial - I just didn't realize what I was looking at in the tutorial until I started playing with each example. Thanks again!