How do I turn of the entire navigation block for users that are not logged in? I only want this box to be visible for users who is logged in. I know that I can turn it of in administer->blocks but that also affect the logged in users, I dont want that.

(Ps. Tried to search the forum but didn't found what I was looking for).




straider’s picture

That's easy. It takes just two steps:
* You disable the Navigation block in administer->blocks by setting Active to Off and Custom to On. This means that by default, the block will not be displayed, but for registered users the setting can be override.
* You edit for "each user" the blocks each one wants to be visible. You'll notice that for the user the Navigation block will be off by default, but after you enabled it and click on Save button, than that user will see the block.

The question here is: there is a way to set it globally, instead on a per-user basis? I don't know.

Askilus’s picture

If I need to configure this for each user thats not an option. If it is possible to make it enabled by default for registred users (ie by having the checkbox in the users profiled checked by default) that would be an option.

The thing is that its one single module that's messing with me. The Feedback module creates a link in the navigation box. I already have a link for this page in my top-menu and don't want it there (since this then is the only link in the navigation block for non registred users). I tried a real ugly thing and commented out the function creating the link in feedback.module but that only resulted in an empty navigation block and that is of course even ugglier.


DiscoFreq’s picture

I have the same problem with the event module...
(at http://www.grasjas.be)


Dries’s picture

We should extend the block configuration page for that, much like we added a 'page type check' in Drupal 4.6. This would be highly commit-able (core worthy).

erima’s picture

I'm also for this!

sammos’s picture

to make a block disapper when not logged in, turn off the offending items that appear when not logged in via Administer | Menus. Before 4.5 you could tweak the code but with menus this was no longer necessary.

if no items within the block are set to appear, then the block itself won't appear either.

tostinni’s picture

You can consider this patch View blocks by roles

Don't hesitate to send feedback ;)

mattmm’s picture

I accidently deactivated navigation entirely and can no longer see admin options. How can I reactivate?



behindthepage’s picture

This link will take you to the blocks menu to switch it back on.

or this one will take you to menu page

"If we can see further it is because we stand on the shoulders of giants"


tostinni’s picture

Just type /admin/block next to your drupal URL and you get it back.
edit : Beaten ;)

behindthepage’s picture

To solve the the problem of the original post.

Create a Custom Block with the following code and your Navigation Block will only be displayed for users that are logged in.

global $user;

//Print Navigation menu
         $sna = module_invoke('menu', 'block', 'view', 1);
         print $sna['content'];

Then disable the original Navigation Block

"If we can see further it is because we stand on the shoulders of giants"


lsabug’s picture