Help with icons for Menu theme

daneesia - August 14, 2007 - 03:38

Hi all.

I am still relatively new to all this and I recently borrowed some code to theme the secondary menu items and I think it is choking on the integration with the "me" module.

Here is the code for menu_item.tpl.php:

<?php

$link
= menu_item_link($mid);
// replace spaces with "_", and strip HTML
$css_id = str_replace(' ', '_', strip_tags($link));
// render the menu link with unique CSS id.
$output = '<li id="'.$css_id.'" class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. $link . $children ."</li>\n";
print
$output;
?>

Here is the code for template.php:

<?php

...

function
phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
  return
_phptemplate_callback('menu_item', array(
       
'leaf' => $leaf,
       
'mid' => $mid,
       
'children' => $children
   
));
}
?>

finally, here are a few lines from style.css:

li#My_account a{
  background-image:url(images/view_user.png);
  margin-left:4px;
}

The problem is any menu item that is pointed to with user/me/nodename only shows the icon for the parent menu item.

Any idea how to "fix" this?

Thanks in advanced,

Dan

read

holydrupal - August 29, 2007 - 08:14
 
 

Drupal is a registered trademark of Dries Buytaert.