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.

Customising the CMS /

Possible to determine allowed_children on the fly?


Reply


612 Views

Avatar
pingu

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"
}