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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Possible to determine allowed_children on the fly?

Go to End



Community Member, 75 Posts

29 November 2010 at 5:48pm

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"