Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Nested Related Pages - How

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

Page: 1
Go to End
Author Topic: 830 Views
  • tazzydemon
    Avatar
    Community Member
    114 Posts

    Nested Related Pages - How Link to this post

    Sirs

    I have added a tab to my editor setup in Page.php like so:

    $fields->addFieldToTab( 'Root.Content.Related Pages', new TreeMultiselectField( 'LocationList', 'Related Pages', 'SiteTree' ) );

    It appears to work fine in the first level but in fact my related pages themselves have related pages. I need to get them as well but now I have no idea how.

    I am trying to generate something like

    <h3>First Level Related Page</h3>
    <div>some content</div>
    <h4>Second Level Related to the one just above<h4>
    <h4>another Second Level</h4>

    And so on. How do I recurse down the tree to get the second level pages so I can put a control on them in the template?

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