Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » disable subpage creation

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

Page: 1
Go to End
Author Topic: 1098 Views
  • holy noli
    Community Member
    6 Posts

    disable subpage creation Link to this post


    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

  • Ingo
    Forum Moderator
    801 Posts

    Re: disable subpage creation Link to this post

    put this into your Page class

    static $allowed_children = array();

    Haven't tested it, but should work

  • inCharge
    Community Member
    102 Posts

    Re: disable subpage creation Link to this post

    > 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.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.