PWaddict Posted April 5, 2017 Share Posted April 5, 2017 How to hide the "Tree" dropdown menu from the Pages admin navigation on non-superusers? Link to comment Share on other sites More sharing options...
Christophe Posted April 5, 2017 Share Posted April 5, 2017 Hello, A more advanced user will certainly help you. But this module by @tpr perhaps already allows it: Which version of ProcessWire are you using? (Have you tried with a css rule added if the admin user is not a superuser? Or do you prefer a non-css solution - because it is not enough?) Link to comment Share on other sites More sharing options...
PWaddict Posted April 6, 2017 Author Share Posted April 6, 2017 Actually I needed to hide the entire "Pages" tab menu and I did it with css on the Admin Custom Files module. How can I add a css rule that only applied if the admin is non-superuser? I'm using the lastest dev 3 version. Link to comment Share on other sites More sharing options...
Robin S Posted April 8, 2017 Share Posted April 8, 2017 @PWaddict, if you want to hide just the Tree menu I made a module for that: On 6/04/2017 at 4:24 PM, PWaddict said: How can I add a css rule that only applied if the admin is non-superuser? AdminOnSteroids adds some classes to the body element that can help with this: https://github.com/rolandtoth/AdminOnSteroids/wiki#extra-classes-added-to-body-tag So you can prefix your CSS rule with body.role-nonsuperuser 3 Link to comment Share on other sites More sharing options...
dotnetic Posted April 12, 2017 Share Posted April 12, 2017 Although Robin S´s module might "hide" the menu entry it is still accessible if you know the URL. To restrict non-superusers and redirect them to another page after logging in, you need to do it different. I wrote a module for that case which you can find at https://github.com/jmartsch/ProcessRestrictTreeMenu. It is not configurable yet, but you can change the code in the .module file. Link to comment Share on other sites More sharing options...
tpr Posted April 12, 2017 Share Posted April 12, 2017 What is the benefit of hiding the Tree menu? If the user clicks on the "Pages" he will get the same content, or am I missing something? 1 Link to comment Share on other sites More sharing options...
PWaddict Posted April 12, 2017 Author Share Posted April 12, 2017 1 hour ago, tpr said: What is the benefit of hiding the Tree menu? If the user clicks on the "Pages" he will get the same content, or am I missing something? Because I'm hiding few pages from my clients but on the tree they were still visible. Link to comment Share on other sites More sharing options...
tpr Posted April 12, 2017 Share Posted April 12, 2017 How do you hide those pages? This sounds like a bug in the Tree dropdown, imo it should display the same pages. Link to comment Share on other sites More sharing options...
Robin S Posted April 12, 2017 Share Posted April 12, 2017 3 hours ago, jmartsch said: Although Robin S´s module might "hide" the menu entry it is still accessible if you know the URL. I think there is some confusion because the word 'tree' has in the past sometimes been used to refer to the page list (ProcessPageList) but now labels the dropdown 'Tree' menus. To be clear, the intention behind my module is not about preventing roles from accessing the page list, it's about removing the dropdown menus which I consider to be a confusing UI for roles with limited editing access. There is a related GitHub issue open here: https://github.com/processwire/processwire-issues/issues/231 2 Link to comment Share on other sites More sharing options...
adrian Posted April 12, 2017 Share Posted April 12, 2017 Just wanted to chime in to say that I had similar issues with the Pages > Tree menu with my AdminRestrictBranch module, but I solved it quite easily by hooking into: ProcessPageList::executeNavJSON and making sure the list was restricted there. Link to comment Share on other sites More sharing options...
dotnetic Posted October 23, 2018 Share Posted October 23, 2018 Please read my comment about a proposal change for what is rendered in the navigation 1 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