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.

Template Questions /

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

Preventing certain page types being children of other page types


Go to End


1059 Views

Avatar
doubleedesign

Community Member, 19 Posts

20 December 2010 at 8:51pm

I have successfully restricted a user group that my client will be part of from creating certain types of pages using canCreate(), so now there are only 2 page types left (the 2 they will actually need) - Page and ArticlePage (as per the tutorial).

The problem is, one can create an ArticlePage as a child of ANY page, not just the news page (ArticleHolder). Is there any way to restrict ArticlePage to only be able to be created as a child of ArticleHolder - pretty much the reverse of allowed_children, like a "not allowed children" type concept, to specifically disallow the creation of ArticlePages as children of regular Pages?