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.

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

declare menu2 to only pull sub pages from a certain page. - HELP!


Go to End


3 Posts   1179 Views

Avatar
DannyC

Community Member, 3 Posts

13 February 2011 at 2:13am

Edited: 13/02/2011 2:15am

Hi All,

I have pages with sub pages.

In my home page footer I have page headings and I want to list the sub pages under the page headings.

How to I declare menu2 to only pull sub pages from a certain page.

I.E.

Page Heading_____Page Heading_____Page Heading_____Page Heading
Sub page_________Sub page________Sub page_________Sub page
Sub page_________Sub Page________Sub Page_________Sub Page
Sub page_________Sub Page________Sub Page_________Sub Page

I want to do this seperatly so each page heading is a separate menu2 declaration if that make sense.

etc.

If anyone can help, that would be great!

Cheers

Danny

Avatar
Willr

Forum Moderator, 5523 Posts

13 February 2011 at 3:35pm

Well you can use <% control ChildrenOf(page-url) %> to get the children of a given page. Or if you are making the list of Page Headings from a <% control Menu(1) %> then you can use <% control Children %>.

Avatar
DannyC

Community Member, 3 Posts

13 February 2011 at 9:57pm

Hi Willr,

<% control ChildrenOf(page-url) %> worked for me.

Thanks for your help.

Danny