By benjitastic on
Hello,
I would like to add a menu item just above the "create content" one. The problem is: when I do this it is visible even when I'm not logged in.
How do I create a menu item that can only be seen once you're logged in?
Thanks!
Ben
Comments
Try
the Menu-Per-Role module.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
TRY
Just go to navigation block and there is set visibility option check radio button show block if PHP code return true
then type code which will check user->role==admin
thats it
in this code i only got one admin with user id =1
so the menu will b available to admin
n i created a different block for users
TRY
Just go to navigation block and there is set visibility option check radio button show block if PHP code return true
then type code which will check user->role==admin
thats it
in this code i only got one admin with user id =1
so the menu will b available to admin
n i created a different block for users
Configure menu block vissibilty settings
Goto
http://www.mysite.com/?q=admin/build/block.
Configure the navigation menu.
Role specific visibility settings and check the roles you want the menu block to be displayed.
Shyamala
Team Leader (http://www.netlinkindia.com)
Shyamala
http://www.unimitysolutions.com
That affects the whole menu
That affects the whole menu, not one specific item.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Who should be able to submit content?
Concerning the roles who should be able to submit content: Do you want it to be you only, admins only, or everyone who is logged in to your site?
Menu per role still does the job, but if you want it to be you only, the code snippet above is probably much quicker.
//Johan Falk, Sweden
Item access, too
Menu per role allows not only blocks to be visible to specified roles only, but also to make menu items visible to chosen roles.
However, this is done through the menu administration, and not the blocks administration.
(I'm pretty sure it's the Menu per role that allows me to make these customizations at my Drupal site. Please tell me if I'm wrong, and I'll try to look up which module it is that does the trick.)
I hope this helps.
//Johan Falk, Sweden
PS: And, yeah, you'll need to have an admin role in order to restrict access to that role only. It may seem silly if you're only using the very first user login (which automatically have access to everything), but unless you restrict visibility to at least one role, items/blocks will be visible to everyone.