fromholdio / silverstripe-no-edit-message
Display friendly message in CMS on pages where user has no edit perm, rather than read-only form.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- silverstripe/cms: ^5.0
This package is auto-updated.
Last update: 2024-10-23 04:46:34 UTC
README
Display friendly message in CMS on pages where user has no edit perm, rather than read-only form.
Includes replacing page History interface with message too.
To implement:
Page: is_no_edit_message_enabled: true # default: true
And the following must be added to your Page
public function getCMSFields() { if ($this->doShowNoEditMessage() && Controller::curr() instanceof LeftAndMain) { return $this->getNoEditCMSFields(); } # ... any other regular code. } public function getSettingsFields() { if ($this->doShowNoEditMessage() && Controller::curr() instanceof LeftAndMain) { return $this->getNoEditCMSFields(); } # ... any other regular code. }
Hooks are in place to amend the message, the tab path and fields, and even the trigger for when to display this (OOTB this applies when canEdit is false).