Jump to content

How to hide 'who can access this page?' section


gfdesign
 Share

Recommended Posts

Hello again.
I'd want to customize the admin for my client. My intention is to hide one panel for one specific user. Information related to users/roles I wouldn't want be visible, so... How should you do if I want to hide "Who can access this page?" panel in Setting page for one specific user? Should I do it through .css instead?

This is the panel (red) I want to hide:

2uxy1jb.jpg


Any clue will be welcome :)
Ps: Sorry, the title should be "How to hide 'who can access this page?' section", but I didn't find how change it :-[

Edited by gfdesign
Link to comment
Share on other sites

Given that this piece is informational only, and not tied to any user input, hiding it with CSS or JS seems adequate. 

This one may be tricky to target with CSS since it doesn't have a defined id attribute. But I think you could do it with:

#ProcessPageEditSettings .InputfieldMarkup:first-child { display: none; } 

You can put this in your own css file in /site/templates/styles/admin.css. Then edit your /site/templates/admin.php and put this at the top (after the opening php tag):

$config->styles->add($config->urls->templates . 'styles/admin.css'); 
  • Like 1
Link to comment
Share on other sites

Thanks for reply Ryan, but I'm afraid your solution could hide other
panels due to the markup is similar in other panels (I guess I have seen
this markup in other panels).

In the other hand, Soma's solution does exactly what I wanted.
Many thanks to both.

Link to comment
Share on other sites

Thanks for reply Ryan, but I'm afraid your solution could hide other

panels due to the markup is similar in other panels (I guess I have seen

this markup in other panels).

This isn't correct, as the CSS selector is specific to focus on the panel you asked about. It's already targeting the settings tab, and the ":first-child" as part of your CSS selector focuses it on the "who can access" field. Without that, it would hide the "info" field as well. But I agree it's better to use Soma's solution as that removes it from the markup entirely. 

  • Like 1
Link to comment
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
 Share

×
×
  • Create New...