Hide Navigation Menu-Block on Menu-Site when logged in

gr4phic3r - June 19, 2008 - 17:21

hello

i have an "admin" user and a account for an "editor". the "editor" has also his own role.
i disabled the most stuff in the menu for the "editor" because he should see as less menu-items when he is logged in then possible.

on the adminsite of the menu are the primary links (which you can see on the website when you´re not logged in), but there is also the navigation part. i just want to disable that for the "editor" user, because he won´t need it. can someone help me with that problem please? i´m not a php coder btw.

thanks

Go to the blocks page, look

marcvangend - June 19, 2008 - 18:19

Go to the blocks page, look for the 'navigation' block, click the 'configure' link and choose the appropriate "Role specific visibility settings".

i know these settings

gr4phic3r - June 21, 2008 - 11:26

i don´t want to hide the menu on the left side
i want to hide the listing of the navigation-menu in the content area
i made a screenshot http://www.multivitamedia.at/markus/screenshot.gif

greets

AFAIK, there is no ready

marcvangend - June 21, 2008 - 18:29

AFAIK, there is no ready made solution for this at the moment. I happen to have created a feature request for this a while ago: http://drupal.org/node/241972.

For the time being there probably are workarounds (although I've never tried doing this). For instance: adding the role as a class to the body tag (using the themer module, http://drupal.org/project/themer) and then hiding the navigation menu part using css.

thanks for the link, but i

gr4phic3r - June 21, 2008 - 20:05

thanks for the link, but i don´t know how do you this, because i´m not a php-coder :(
i can copy and paste stuff ;)

greets

You don't need any php

marcvangend - June 22, 2008 - 07:20

You don't need any php coding for this. Installing a module is very simple, read the documentation on this site if you don't know how to do it.

You will need some knowledge of css to do this. If you have not written or edited css files before, I highly recommend to find yourself a tutorial online and learn css, it is very usefull when creating websites.

a little hack

gr4phic3r - June 22, 2008 - 10:43

i made a little hack in the box.tpl.php file
added the IF command to check which user is logged in ... i have only 2, so "editor" and "anonymous" is enough ... i don´t know how to check if it is the super admin or not, but this works fine for me ...
when the editor logs in, he sees only the menu part on the menu-admin site, the navigation part is hidden

<?php if (($title != "Navigation") || ((in_array('editor',$GLOBALS['user']->roles)) != true) && ((in_array('anonymous',$GLOBALS['user']->roles)) != true)) { ?>

  <div class="box">
    <?php if ($title): ?>
      <h2><?php print $title ?></h2>
    <?php endif; ?>
      <div class="content"><?php print $content ?></div>
  </div>

<?php } ?>

thanks for your time and help
greets

User no 1

marcvangend - June 22, 2008 - 19:30

The Drupal superadmin always has user ID 1, so if you want to check if the user is logged in as superadmin, use:

if ($GLOBALS['user']->uid == 1) {
  // do something
}

i think that would work too

gr4phic3r - June 28, 2008 - 12:45

i think that would work too ;)
thanks

greets

www.multivitamedia.com
webdesign - graphics - webhosting

 
 

Drupal is a registered trademark of Dries Buytaert.