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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

how to set the default parent for all pages of a certain type


Go to End


2 Posts   1341 Views

Avatar
longy

Community Member, 5 Posts

14 November 2012 at 2:04am

I manage certain types of pages that can not be root and can not have children through ModelAdmin.

But I should be able to set the parent before creating the page I get an error otherwise.

how can I set the default parent for all pages of a certain type?

Avatar
zenmonkey

Community Member, 545 Posts

7 December 2012 at 2:39am

There was a default parent function before ss3 but it'd no longer there. If it has to a specific page you can manipulate the parent ID in onBeforeWrite. If it has to be a a specific type the way is to specify allowed_children on every page type, listing every page type except the child class.

I hope allowed parent will work its way into 3.1