Jump to content
PWaddict

Hide "Tree" dropdown menu ???

Recommended Posts

How to hide the "Tree" dropdown menu from the Pages admin navigation on non-superusers?

tree.jpg

Share this post


Link to post
Share on other sites

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?)

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

@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

  • Like 3

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

  • Like 1

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

How do you hide those pages? This sounds like a bug in the Tree dropdown, imo it should display the same pages.

Share this post


Link to post
Share on other sites
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

  • Like 2

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Please read my comment about a proposal change for what is rendered in the navigation 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...