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.

General Questions /

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

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

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


Reply


3 Posts   765 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, 5513 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