parent menu item highlighted

msn - April 16, 2008 - 22:45
Project:Menu Block Split
Version:5.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Beautifull module for mixing horizontal and vertical related menu's!

But how can I higlight the parent menu item when a child is active?
The example on the demo site has this relation, how do I do that?

#1

mediamash - April 22, 2008 - 07:11

i'm looking for this solution too. The Demo site has active classes for each submenu. So i think they have alterd the output for that. Anyone knows how to do that?

#2

msn - April 22, 2008 - 09:28

I did not get this working with Menu Block Split.

I found another module: slicedmenu.module who does the trick: http://drupal.org/project/slicedmenu. You get an active class in main- and submenu to use in .css

css example:

#block-slicedmenu-0 ul.menu .active {
background-color: #E97001;
color: White;
}

#block-slicedmenu-1 li a.active {
color: White;
}

#3

mediamash - April 22, 2008 - 12:48

msn, does the mainmenu remain active when clicking several submenus?

#4

msn - April 23, 2008 - 00:45

yes

Try it out on: http://www.mirakel.cmseasy.nl/test
login with: gast / gast

#5

robertgarrigos - April 27, 2008 - 16:06
Status:active» fixed

I achieved that functionality by overriding the theme_menu_item function. This is the actual function I'm using with that theme on the demo site:

function escoles_menu_item($mid, $children = '', $leaf = TRUE) {
  return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) . (menu_in_active_trail($mid) ? ' actual' : '') .'">'. menu_item_link($mid) . $children ."</li>\n";
}

You need to add this function to your template.php file in your theme. Change the name of the function escoles_menu_item to thenameofyourtheme_menu_item (look in the handbook for overriding theme functions: http://drupal.org/node/55126). I'm using a class 'actual' in the css to highlight the parent menu item. You can change the name of that class to any other you might be using.

#6

Anonymous (not verified) - May 11, 2008 - 16:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.