Download & Extend

Active-trail class (dis)appears randomly

Project:Acquia Prosper
Version:6.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

The active-trail class seems to (dis)appear pretty randomly from the primary menu. As a result, the active menu item might not be highlighted. Sometimes it helps just to delete and recreate the menu-entry. Is this a theme or core related issue? Is there a fix? I haven't tested this very thouroughly and haven't seen this problem on other website I've built with this theme. In this case, menu entries are like this: view-name/argument

Comments

#1

Category:bug report» support request
Status:active» postponed (maintainer needs more info)

Hi,

The active-trail class is assigned by Drupal Core, not by the theme. When you say it is disappearing, do you mean that when the page loads the menu item may not have the proper active-trail class, or do you mean that the status of the active-trail class is changing after the page has loaded, without reloading the page?

If the change is only happening when the page is reloaded, I would look to any modules installed on your site the interact with menus at all. I would suggest clearing the site's cache (which will rebuild the menu) and checking the issue queues of any menu-related modules you may have installed.

If the change is happening dynamically (without re-loading the page) then there might be some javascript interacting oddly with the menu. It would be very helpful to see your site and get an idea of what exactly is going on.

Thanks,
Sheena

#2

I think I've found this issue when using catalog/23 etc as a link from the menu.

To change the background on the menu I've needed to add

.primary-menu-inner ul.menu li.active a.active {
stuff here
}

to local.css

If I have a normal node as a menu item the <li> gets assigned a class of 'active-trail' (as well as 'active') and it's the 'active-trail' which is used in the gray.css.

So, when the link is to catalog/[id] the Drupal system is giving an <li> with class active - and this is not linking to the stylesheets.

So,

1. Something should be changed so that Drupal outputs the catalog menu link with a class of active-trail added to the <li> element.

or
2. gray.css should be changed to link to li.active as well as li.active-trail

Hope that helps!

#3

Could I get a link to your site so I can investigate the issue further?

Thanks!

#4

@sheena_d (didn't want to open a pretty similar issue, so subscribed here):
I cannot at all get the active-trail work in my primary menu with acquia_prosper-6.x-1.1
active trail works in my footer region menu but never in primary.

see: www.sea-of-pearls.com

I tried all possible combinations to get the right classes and id in css manipulated, also checked out other acquia_prosper sites code with firebug to copy the right css but without no result on my site (workss on their sites :-(

I guess that would "normaly" work:

.primary-menu-inner ul.menu li.active-trail a.active {
background-color: transparent;
text-decoration: underline;
}

active trail works in my footer region menu but never in primary menu w/ acquia_prosper

.footer .fusion-inline-menu .inner ul li.active-trail a.active {
background-color: transparent;
color: #535353;
text-decoration: underline;
}

thx for any hint!

-S

#5

Störtebeker,

I looked at your site and your menu items are not being assigned the active-trail class. I tested a clean install of Acquia Prosper on my local machine and the active-trail classes are being assigned appropriately. My guess is that something is going on in the configuration of your site that is causing the menu trails to be inaccurate. Are you using any modules that affect the menus? Have you made any changes to Acquia Prosper other than the local.css file, such as changes to template.php?

You also might want to look into the Menu Trails module, as it might help you set the appropriate menu trails.

Any other info you can give me to help re-create the issue would be greatly appreciated.

Thanks,
Sheena

#6

Sheena,

thx for your quick reply (I haven't received a notification for your reply for unknown reasons so I just got back to this issue now).

The configuration might be the reason so I disabled several modules (just guessing if they affect the menu at all) but w/o any success.

template.php has some minor replacements but I also commented them out - again w/o any success.

Is there any documentation how and where in acquia fusion the primary menu is being handled?
Maybe I start from there?

Thx
S.

#7

Status:postponed (maintainer needs more info)» active

#8

Sorry but I can't provide a link as it's an internally developed site.

I'll repost my message to make it clearer:

--------------------------------------
The issue is that when you have a node link in a menu the CSS classes are slightly different from when you have a link to a catalog in the menu. Because the class is slightly different it no longer links to the needed style in gray.css.
--------------------------------------

I think I've found this issue when using catalog/23 etc as a link from the menu.

To change the background on the menu I've needed to add

.primary-menu-inner ul.menu li a.active {
background: none repeat scroll 0 0 #F4F4F4;
}

to local.css to get the effect working - this is because a catalog link in the menu outputs a class of 'li.active' which is not in the acquia prosper stylesheet - if it is a node link it produces class of li.active-trail which is in your acquia prosper stylesheet.

So, if I have a normal node as a menu item the <li> gets assigned a class of 'active-trail' (as well as 'active') and it's the 'active-trail' which is used in the gray.css.

But, when the link is to catalog/[id] the Drupal system is producing an <li> with class active (li.active) - and this is not in to the stylesheet in acquia prosper.

So,

1. Something should be changed so that Drupal outputs the catalog menu link with a class of active-trail added to the <li> element. - i.e. <li class="... active active-trail ...">...</li>

or
2. gray.css in acquia prosper should be changed to link to li.active as well as li.active-trail - probably about line 212 in gray.css.

Hope that helps!

#9

Status:active» needs review

I see what the issue is. Something is causing the active trail assignments to be lost from these menu items. I am going to guess it has to do with Ubercart's processing of taxonomy pages - I was not able to fix the issue using Menu Trails and the issue does not occur using Drupal-rendered taxonomy pages (and the issue occurs in Garland).

The core issue here is not related to Fusion. However, the work-around is not complex and I believe will not pose conflicts elsewhere within the theme.

I am attaching a patch that fixes this issue for both the Gray and Blue design packs.

AttachmentSize
catalog-page-activetrail-fix-1131862-9.patch 1007 bytes

#10

Great, inserting
.primary-menu-inner ul.menu li a.active
solved the problem!!!

Thx a lot!!!

Stort