With Kirby 2.1 we have a new ‘Status: visible’ button in the panel sidebar which toggle the visibility of a page. Are there any ways to lock this button from the panel users (in certain templates)?
I need to lock this button to prevent user (accidentally) changing the site’s structure.
Before 2.1, I can lock the root level structure by setting:
page: false
in site/blueprints/site.php, and
deletable: false
in all root level blueprint PHP files.
Now with the new ‘status’ button, user can not only hide or show a page, but as a side-effect change the sequences of the pages.
Looking at the sidebar template files, it seems that there’s no options similar to deletable
. Are there any workarounds to hide this new button without changing core files? Thanks.
As far as I know, this is currently not possible but there are plans to make this feature optional, see this issue on Github https://github.com/getkirby/panel/issues/420
As a workaround, you could possible just hide the option in a custom panel stylesheet without an option to do that on a per page basis though.
Thanks.
Using CSS is a possible way, but far from ideal.
The main problem being the lack of CSS classes / id to identify the button…While I can target the button with a few :nth-child selector, it’s quite possible that the user still sees the button if they’re using older browsers.
So far the only guaranteed way would be removing line 23 - 35 in panel/app/snippets/pages/sidebar.php
. Which however should be the last resort as it involves changing the core files.
I know, in fact, I’d love to prevent URL changes as well, but I guess we have to wait a little bit longer for that to be implemented … Maybe @distantnative or @bastianallgeier can provide an ETA by now?
Some have already spotted the pull requests for a first draft of this (so this will be possible through the user permissions system coming soon), but no ETA.
Thanks. Hope it would be implemented soon!
Btw should I change the status to ‘Solved’ or ‘Suggestion’ or just leave it open?