Hi
I would like to remove the ability in the Sliverstripe for admin users to creating subpages. Only would like top level pages. Would appreciate if someone could point me in the right direction
thank you
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Hi
I would like to remove the ability in the Sliverstripe for admin users to creating subpages. Only would like top level pages. Would appreciate if someone could point me in the right direction
thank you
put this into your Page class
static $allowed_children = array();
Haven't tested it, but should work :)
> static $allowed_children = array();
This is better than nothing, because if you click the 'Create' button with the restricted page selected, it jumps up a level and selects the parent.
However, if you select the restricted child again, you can add a sub-page.
There is no option in the page type list for 'No page can be created at this level', so I doubt it is possible to prevent a sub-page from being created without CMS enhancements.
An alternative approach would be to define a maximum menu depth somewhere. Is that currently possible?
Either way, it would be a good feature, because it is common that menus that only work to a given depth.