Jump to:

5521 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Possible to determine allowed_children on the fly?

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

Page: 1
Go to End
Author Topic: 569 Views
  • pingu
    Avatar
    Community Member
    75 Posts

    Possible to determine allowed_children on the fly? Link to this post

    I was just wondering if it's possible to determine the allowed_children of a page type on the fly?

    I have a Holder type which I'm using in multiple instances. The only difference between each instance is the children that's allowed per holder, and if its possible I'd like to not have to extend the holder class just to encapsulate this information.

    I'm wondering if it's possible to do something like this:

    if($this->Title == "Activities"){
    $allowed_children = "Activity"
    }

    if($this->Title == "Events"){
    $allowed_children = "Event"
    }

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