Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Disable page delete

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1782 Views
  • Sec
    Community Member
    13 Posts

    Disable page delete Link to this post


    I have a site structure that would benefit the option that admins could not delete certain page types from the cms in order to keep the intended functionality. Is this possible?

  • Blackdog
    Community Member
    156 Posts

    Re: Disable page delete Link to this post

    Put this in your Page model and replace PageType withy your page type.

       function canDelete() {
          return false;

    Also try this one if you don't want them to create any more pages with that type.

       function canCreate() {
          return !DataObject::get_one("PageType");

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.