views:

13

answers:

1

hi,

I've a menu item linking to a page that requires authentication to be visited.

If I'm not logged-in, Drupal hides the menu item, beucase I cannot visit the page.

I would like to change this setting, and display the menu item also to guests with a link to the login page instead.

Thanks

+1  A: 

I won't say that it can't be done, but this will be extremely difficult, as you probably have to override the generation of the menu, which is some pretty complicated stuff.

An alternative and much easier solution would be to have both menu items in your menu, but to hide one of them.
If the user just needs to be logged in you can check the body class, as it by default will put a class to show if the user is logged in or not. You can use that to make two different styling rules, hiding the menu item that shouldn't be displayed to user.
If the access check is a bit more complicated, you can do it in the preprocess_page function in your theme and add extra classes to your body tag.

googletorp

related questions