Jump to:

23358 Posts in 17873 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » declare menu2 to only pull sub pages from a certain page. - HELP!

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

Page: 1
Go to End
Author Topic: 666 Views
  • DannyC
    Avatar
    Community Member
    3 Posts

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

    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

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: declare menu2 to only pull sub pages from a certain page. - HELP! Link to this post

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

  • DannyC
    Avatar
    Community Member
    3 Posts

    Re: declare menu2 to only pull sub pages from a certain page. - HELP! Link to this post

    Hi Willr,

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

    Thanks for your help.

    Danny

    666 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.