By lepton on
I created a page and a menu item for it. I have simple access module installed. I only want this page visible to logged in users. I set simple access to only allow authorized users, and that works ok, but the menu item remains visible in the navigation menu regardless.
I want the menu item to appear only for authorized users but I don't see the way to do it. I'm new at Drupal.
-Mike (New site at www.myallo.com)
Comments
try this thread
try http://drupal.org/node/55296
searching for 'restricting menu' will return a few more threads.
Restricting Individual Menu Items
Lepton,
I understand what you want to do. I haven't seen it covered, correctly, in any other post, without having to add some PHP code. I have the Primary Links menu, at the top of my page. I want EVERYONE to see that menu, but I want to add a "My Account" menu item, that only logged-in users will see. Creating a different menu doesn't really solve the problem. It's just a workaround.
This option should be included in the Menu module.
Ed Coyne
http://www.angelopc.com
Update: I'm using Suckerfish menus on my site. All I did was create another menu (only one menu item) and added the block to the Suckerfish Menu area and edited the visibilty settings. It displays right along side of the Primary Links menu and it only displays to logged-in users.
restrict menu item to logged in user
In drupal 6, you can use hook menu in your custom module:
Notice the access calback function on the second item. This will restrict your page to only logged-in users.
Check out the documentation on hook_menu