By AndrewE on
I went into adminster>blocks>navigation block configuration and I have 3 options:
-Users cannot control whether or not they see this block.
-Show this block by default, but let individual users hide it.
-Hide this block by default but let individual users show it.
But what I would like to do is have the nav block off when the user is not logged in. So for someone simply browsing the site, they wouldn't see the navigation block unless they created an account and logged in.
Can anyone help me with this?
Thanks
F.Q.
Comments
menu.module
You might trying to enable menu module, and disable any menu items that would be visible to an anonymous user. If you can strip out all of the block content for anonymous users, I don't think that the block will display.
Of course, the menu items that you disabled will not be available to either anonymous or authenticated users...
--
Bjorn | choirgeek.com
I had the same question...
Try this thread http://drupal.org/node/13013. I believe this should work for you.
larry
--There are no Kangaroos in Austria--
Thanks
Thanks for the links, but the suggestions there are for 4.5 and before, I'm using 4.6 Also I am not good a PHP so writing my own modules or patching and stuff is very difficult for me.
I guess I'm just going to have to live with that navigation bar always on for the time being. Unless there is an easy way of doing it.
mechanical i
works for 4.6 as well
Ok. This is the easy way. Open the user module in any editor of your choice...'Notepad' on windows for example. Either go to line 524 or search for the phrase 'case 1:'. Underneath this put 'if (!$user->uid) return;'. Here is 'before' and 'after' shots.
before:
after:
save the changes. Boom, you've just gotten what you wanted. Hope this helps.
larry
--There are no Kangaroos in Austria--
Larry you are a star!
Thank you so much for the tip. It worked straight off the bat!
It looks much tidier now.
F.Q.
TGR- a writer's space
glad to hear it worked for you...
cheers.
larry
--There are no Kangaroos in Austria--
Thanks Larry
Hi,
I have tested it on 4.6.2 and it ran!!!
Now only registered users have acces to the lasts posts!!!
Thanks a lot!!!
Awesome!
I was searching around for this answer as well. For some reason one of my admin menu items started popping up on non-registered user pages. This cleared it right up! THANKS
Actually, it only worked partway
Actually, it only worked partway, knocking out the admin completely for non-admins. For a more comprehensive solution, see the code mod I came up with....
http://drupal.org/node/34677
...or if you'd rather not muck with the core code, try tclineks' solution...
http://drupal.org/node/38427