Closed (fixed)
Project:
YUI Menu
Version:
5.x-2.4
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2008 at 14:00 UTC
Updated:
24 Apr 2008 at 14:12 UTC
I was trying to show the yuimenu to only one role and I couldn't find any docs available. I want to share my solution:
Add this to the page.tpl.php, you will have to change "users" in $approved_roles = array('users'); to the role name of your choice. This helps so you can hide the menu to annonymous users. Thanks to the developer of this module, I was trying to use an alternative to simplemenu as I found it very hard to theme.
<div id="yuimenu">
<?php
global $user;
$approved_roles = array('users');
if (is_array($user->roles)) {
if (count(array_intersect($user->roles, $approved_roles)) > 0) {
print html_menu(variable_get('yuimenu_root','1') );
} else {
}}
?>
</div>
Thanks to http://drupal.org/node/86241
Comments
Comment #1
lelizondo commentedjust to change the status
Luis
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.