By erikajune on
Is this possible? I have a javascript menu I would like all users to see but the navigation menu I want only visible to admins.
Is this possible? I have a javascript menu I would like all users to see but the navigation menu I want only visible to admins.
Comments
Re: Navigation for admin only?
I use following setup:
HTH, Kurt
Thank you so much!I
Thank you so much!
I followed all directions until this one where I'm stumped. There is not an option to select this. What do I do?
Select "[] Show if the following PHP code returns TRUE (PHP-mode, experts only)."
Sorry for the delay. The
Sorry for the delay. The option I meant is under:
administer > blocks
Click on "Navigation" configure
There you can paste the php snippet and activate the option
"[] Show if the following PHP code returns TRUE (PHP-mode, experts only)."
Which release is this option available in?
I am running 4.6.3 and do not see "Show if the following PHP code returns TRUE (PHP-mode, experts only)". When did it become available?
me as well....
I'm trying to follow this and don't see "Show if the following PHP code returns TRUE (PHP-mode, experts only)". :( I'm running 4.6.3 as well
~Bit
I'm running cvs (aka 4.7)
I'm running cvs (aka 4.7) Over the weekend I'll try to get 4.6.3 running to see what can be done.
BTW, that code makes the
BTW, that code makes the entire left side disappear. LOL
Re: Navigation for admin only?
Kurt's code above got me started and I came up with a way to work it into 4.6.3. In /modules/user.module, look for "case 1:" and replace...
...with...
You need to replace "UserRole1" and "UserRole2" with any user role(s) you've set up in your admin acess control section that you want to view the navigation menu. If you just have one user role that will have admin privileges, use "if (in_array("UserRole1", $roles))" instead.
Ah, open source... ;)
zoinks, it's inadvisable to
zoinks, it's inadvisable to touch core when you don't have to.
This issue has been discussed in other threads, one example:
http://drupal.org/node/38427
re: zoinks, it's inadvisable to
Thanks for the advice, tclineks. I tried your solution and it totally knocks out the navigation menu for any levels other than admin. Also tried separating out the elements I want other users to see... but couldn't add menu items into another block, or set user levels for new menus. So I'm sticking with my code mod above.
Speaking of my code mod above, it has an extra "{" and "}". It should be....
Otherwise it always shows the "Who's New" module. No idea why! (Yeah, yeah, that's why "it's inadvisable to touch core when you don't have to"...)
Read more of the thread =)
Read more of the thread =)