Blocks Only Seen By Administrator In Drupal

ISSUE
It really does erk me that Drupal doesn’t have an option for administrators in the Show blocks for specific roles when editing a block.

I needed a customized menu for a role (reg_user). This role had limited, basic access to do things. They needed to add news articles (a news content type I created) as well as edit them and edit pages. Rather them clicking Create content –> News, I just wanted a link on the left navigation, as well as a few other customizable links.

I could have edit the navigation menu through Administrator –> Site building –> Menus –> Navigation, etc etc. However, that would also change for the administrator as well as the role I wanted it to be customized for.

Well, long story short, after a while of research, it seemed the only option was to create another menu.

I did create another menu.

Then I ran into another problem. How to display the menu (Reg User Menu) to the reg_user and NOT the administrator, and the Navigation menu to the administrator and NOT the reg_user. It seemed easy enough to do via the specific roles, however, that doesn’t have the option for an administrator.

I also had another issue, the menu was to not be displayed on node/1 (the home page).

FIX
To accomplish all of this:

Reg User Menu – It’s a block when you create a new menu. I gave access to the reg_user. It doesn’t show up for administrators.

Navigation menu – No options were chosen for Show block for specific roles. Instead I did the following in the ‘Navigation’ block:

Page Specific Visibility Settings In Navigation BlockThe code being:

<?php

$r = false;

if (user_access(‘administer’)) { $r = true; }
if (($_GET[“q”] == “node/1”) || ($_GET[“q”] == “node/1/edit”)) { $r = false; }

return $r;

?>

The if statement with user_access tests if it’s an administrator, if so, display the block. The $_GET[“q”] if statement tests if they’re on the home page, if so, don’t display the block.

I really wish Drupal had easier ways to do this. Like I said before, it’d be a lot easier if they only had an Administrator option for the Show block for specific roles.

Currently, I’m dealing with a module issue that needs Clean URLs (which is disabled on our Windows system).

I hope someone can get help from this not well written post…

Dropdown/Flyout Menu Not Working With Drupal Sky Theme

ISSUE
While working on a new Drupal site, the theme I chose, Sky, I noticed the menu wasn’t dropping or flying out in IE. After a few tests, it was actually found out, the menu was working but it was only working on the page where it was linked (or one if its children).

At first I thought this was an IE issue. It wouldn’t work in IE8, so I only imagined it wouldn’t work in IE6 and IE7.

After a few searches, I found nothing. However, since I have so many windows open, I tested it again but it turns out I was in FireFox and it wasn’t working…

Dah, long story short, the menu wasn’t working in any browser except when it was on its proper page or one of its child pages.

FIX
Really simple and stupid and most people wouldn’t even think of it… at least us non Drupal experts.

By going to Administrator then Site Building then Menus then Primary Links, you see a list of all your links and their children. Click on the checkbox under the Expanded column of your drop down. That makes sure it can be expanded or is expandable in other pages.