torf Posted March 26 Share Posted March 26 I know this topic has been addressed several times before, but has anyone a solution in 2025? As for my site manual sorting of the child pages is crucial for some users, but they are not supposed to touch the parent page. Can I achieve this somehow? Thanks Torf Link to comment Share on other sites More sharing options...
MSP01 Posted March 26 Share Posted March 26 This might be a band aid but: If you don't have a huge amount of pages to sort, one possibility is to create a separate page with page reference field, add the pages there and base the sorting on the ordering of this field. Admittedly this is a good solution in some cases and sometimes it's far too inconvinient to do it like this. It's how I usually do web pages main navigation. 1 Link to comment Share on other sites More sharing options...
Robin S Posted March 26 Share Posted March 26 It seems to work if you allow edit access on the parent template in the normal way via the PW admin... ...and then disallow editing on the parent template in a hook to Page::editable() $wire->addHookAfter('Page::editable', function(HookEvent $event) { /** @var Page $page */ $page = $event->object; $user = $event->wire()->user; // Return early if PW has already determined that the user is not allowed to edit if(!$event->return) return; // Don't allow users with the "editor" role to edit pages with the "colours" template if($page->template == 'colours' && $user->hasRole('editor')) $event->return = false; }); 5 Link to comment Share on other sites More sharing options...
torf Posted March 27 Author Share Posted March 27 @MSP01 Thanks - that's an interesting approach, but it's too late for this time - I'd have to rewrite half of the templates. @Robin S That worked. It's still a bit of coding, since in my case it's more then a dozen templates, but it works. Changed the last line to make it a bit easier when working on numerous parent templates: $arr_of_templates = ["parent_1","parent_2","parent_3"]; // and so on if((in_array($page->template, $arr_of_templates)) && ($user->hasRole('editor'))) $event->return = false; Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now