Hi
I am trying to create a new theme based on Omega 960 for Drupal 7. For the menus I am trying to use a variation of the sliding doors technique to include one level of submenus. You can see the site at www.letsgoagile.com
Currently I have used pure CSS to display the sub menu correctly when I hover over a top level item which has another level (blogs). Naturally I would like the sub menu to remain active when I select its parent. Problem is I can't because the class = "active" is set against the link rather than the list item. I.e. <li class="expanded"><a href="/blog" title="" class="active">Blogs</a><ul class="menu">...
I can identify which is the active item by using (in theme_menu_link()):
$output = l($element['#title'], $element['#href'], $element['#localized_options']);
if (stristr($output, 'active')){ ...Trouble is what do I do with it then. In my example drupal_attributes($element['#attributes']) returns class="expanded" which is applied to the li element. I would like to modify this to include active (class = "expanded active").
Any ideas how to do this?
Apologies if this is obvious - I am brand new to theming, php and CSS :-)
Comments
Solved
This is working for me:
Now I just have to figure out how to make the parent li active when I select a child :-)
Well that's embarrassing
Didn't realise the default menu behave differently to those I created (why???).
Active-trail met all of my needs and its back to straight CSS. At least I learnt how the over-ride system works and excercised some very rusty php skills along the way.