[support] How to hide Navigation menu for non-authenticated users?

Morbus Iff morbus at disobey.com
Wed Sep 6 14:58:40 UTC 2006


> How do I hide the Navigation menu for
 > any user who has not authenticated?

In the custom block options for the Navigation menu, you'd be able to 
use PHP code to determine whether to actually display it. Something like 
this would tend to work (untested):

  <?php
    global $user;
    return $user->uid ? TRUE : FALSE;
  ?>

What this is saying is:

  * load in the special Drupal object $user.

  * if the user's user ID exists ($user->uid), then it is
    TRUE that we want to display this block. If it doesn't
    exist (in the case of an unauthenticated viewer), then
    it is not true (FALSE) that we want to display the block.

-- 
Morbus Iff ( i still fail to see what this has to do with morocco )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus


More information about the support mailing list