Hi

I've created the site-wide contact form. Next, I added it to the Main Menu with a path of "contact". All good so far - it links properly to the page. This is all on my lcoalhost.

But Firebugging my Main Menu, I see that one link has no class active-trail.

This is a proper other link:

<li class="first leaf"><a href="/summer-d7/Welcome" >Home</a></li>
<li class="leaf active-trail"><a href="/summer-d7/about" class="active-trail active">About</a></li>  <----- Correct
<li class="leaf"><a href="/summer-d7/Services" >Services</a></li>
<li class="leaf"><a href="/summer-d7/contact">Contact</a></li>
<li class="leaf"><a href="/summer-d7/call">Call</a></li>
<li class="last leaf"><a href="/summer-d7/portfolio">Portfolio</a></li>

And this is the Contact link:

<li class="first leaf"><a href="/summer-d7/Welcome" >Home</a></li>
<li class="leaf"><a href="/summer-d7/about">About</a></li>
<li class="leaf"><a href="/summer-d7/Services" >Services</a></li>
<li class="leaf"><a href="/summer-d7/contact" class="active">Contact</a></li> <----- Wrong
<li class="last leaf"><a href="/summer-d7/portfolio">Portfolio</a></li>

See, the a href has an active class, but not the li

Any suggestions?

Comments

carn1x’s picture

I'm having this problem also, subscribing!

mdylanbell’s picture

Another me-too. Subscribing.

ishadakota’s picture

This is a bug in Drupal 7 - see the discussion and patch at #942782: Custom menus never receive an active trail.

See also a workaround using the Menu Blocks module at http://palantir.net/blog/use-menus-drupal-7-you-need-menu-block-module.

prateekS’s picture

The another way to have a active-trail class,you can use nice menu module.

http://drupal.org/project/nice_menus

Prateek

Prateek Sharma,
Drupaler :)

sonnenmann’s picture

Subscribing +1

qmjeelani’s picture

Copy paste following code in js which is including on site
-------------
pathArray = window.location.pathname.split( '/' );
if(pathArray[2] == 'contact' && pathArray[3] == 'us' ) {
$("ul li.menu-path-contact-us").addClass("active-trail");
}

ferjan’s picture

where do I copy paste this code?