Hi,
what I want to do is to have the root-level menu item visibly different (say background-color: red) when it's active, and when any of it's second-level menu items are active
example:
in the default administration menu, if you go to Administer > Site building (/admin/build) I can get the 'Site Building' menu item to change style, but I can't seem to get the 'Administer' root-level menu item to change background color. The reason I want to do this is let users know which 'section' they're in.
(I do know a bit about CSS but don't really have a handle on reading JS, so I can only guess what the classes are, and how to theme them)
Thanks in advance for your help–
Cheers!
:) Scott
Comments
Comment #1
scottrigbyFrom what I can see – and I may be missing something – there is no way to do this with Simplemenu as it is now.
(see Eric Meyer's recent response to a similar "parent selectors" CSS proposal here).
So with that in mind – and seeing how other similar toolbars (such as Spry menus) allow for the root element to highlight when a child in that menu tree is .active – it would be great if the Simplemenu module could add a class to the root menu item link, like
<a class="active-parent">.I'd be happy to help in any way I can, but my module-building skills aren't really ready to tackle something like this (especially since I don't have a handle on working with javascript just yet)...
Thanks in advance for advice, help, etc!
:) Scott
Comment #2
scottrigbyOr maybe (in Drupal 6 anyway) menu_get_active_trail could be used? http://api.drupal.org/api/function/menu_get_active_trail/6
Any advice from the D6 version of this module would be really helpful ;)
Comment #3
AlexisWilke commentedScott,
To know about the CSS, I generate do a Select All in my browser and then I look at the HTML code classes...
This is a very old issue so I will close it now.
Thank you.
Alexis Wilke
Comment #4
scottrigby@AlexisWilke, yeah, definitely old issue :)