Show active state for both main and sub menu at the same time?

sparkdigital

Sorted! Looking at the example on http://soeder-architekten.de and the CSS sheet that goes with it really helped - all done now, thanks for all your input!

K

sparkdigital

Thanks John,

This should work - in the top level it gives me the class menu_parent to style as the menu current and in the child level it gives me another menu_current. Thanks for the link!

Konrad

JonH

I have to use 2 different menus as the submenu is in a sidebar and the mainmenu is a basic horisontal menu at the top. How do I show active state in both?

Edit: I found the solution here: https://forum.websitebaker.org/index.php?topic=13577.0;wap2

<?php show_menu2(1SM2_ROOT+1SM2_START); ?> and then style .menu-parent

sparkdigital

Thanks Argos,

Will give it a try and will let you know how I get on.

Konrad

Argos

There's no reason to use two separate menus. Try one menu with just <?php show_menu() ?> and use CSS to style the submenu as a horizontal bar.

To set both parent and child active, with your menu call in a container with ID "nav", and the menu UL with class "menu":

/* Active ("current") status main level links */
#nav li.menu-current a,
.menu li:hover>a {blahblah}
#nav ul li.menu-current {blahblah}

/* Gives parent main level link an active status if child is active */
#nav ul li.menu-parent {blahblah}
#nav li.menu-parent a {blahblah}
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

sparkdigital

No, sorry, that didn't work...

Any other suggestions anyone?

Thanks,

K

Tumultus

Try this on your menu and replace class="active" with the class name for your active menu item:
<?php show_menu(101true'[a][menu_title][/a]''''''''''class="active"'0); ?>

sparkdigital

Hi,

I'm wondering if someone can help me with my menu on this new site we're building. It's basically a horizontal menu with a horizontal submenu below. A test version can be seen here: http://test.sparkdigital.co.uk/

The menu is constructed of two seperate menus. The problem is that the top menu is showing the active state nicely when viewing one of the main pages, but when viewing one of the subpages, the active state is only shown for the subpage. Is there any way to show it for both?

Here's the menu code:

<div id="navigation"><?php show_menu(101true'<li>[a][menu_title]</a>','</li>','<ul id="menu">','</ul>','','class="active"'); ?></div>

and for the subnavigation:

<div id="sub_navigation"><?php 
        show_menu
(111true,'<li>[a][menu_title]</a>','</li>','<ul id="sub_menu">','</ul>'); 
      
?>
</div>


Also, has anyone got any ideas on how to sort out the difference in layout between FF and IE? It looks as it should in FF but I need to do some work still on IE - any help would be appreciated!

Thanks,

Konrad