Repro tested with l10n_client:

1. admin/build/translate/import (top level tab "Import" correctly shown as "active")
2. File import is marked "active"
3. Click admin/build/translate/import/package and the "import" tab link loose "active" class

Expected result:
Tab "import" should be kept active while clicking in sub-tabs of the same top level tab.

CommentFileSizeAuthor
#7 drupal6_bug_menu_tabs.png12.44 KBhass

Comments

hass’s picture

Title: Tab link loose active status » Tab2 link loose active status
hass’s picture

Title: Tab2 link loose active status » Tab1 link loose active status if tab2 is active
damien tournoud’s picture

Status: Active » Closed (won't fix)

Well, this doesn't look as a bug. Tabs (menu tasks, in the Drupal language), are active when they are in the menu trail of the current page. On the other hand, links are active when they *directly point* to the current page.

For theming purpose, you can always select li.active a if you want to theme the link of an active tab differently.

Marking as won't fix.

hass’s picture

Status: Closed (won't fix) » Active

Well, this tab2 is in the active menu trail of the top level tab. Therefor a bug

hass’s picture

Title: Tab1 link loose active status if tab2 is active » Parent tab link loose active status if sub-tab is active
damien tournoud’s picture

Status: Active » Postponed (maintainer needs more info)

Hum. Maybe I wasn't clear enough, or I do not see your point.

  • The <li> tags (menu tasks, in the Drupal language) are active when they are in the menu trail of the current page;
  • On the other hand, the <a> tags (links) are active only when they *directly point* to the current page.

In the case you're interested in (the current page is a sub tab, but not the default one), the parent <li> tag should be active, while its link is not. That's perfectly normal because the parent link does not point to the current page.

Is the behavior you're seeing any different from what's described here?

hass’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new12.44 KB

Attached a screenshot. Here you see the sub-tab selected and the top level tab looses the active class, what is a bug.

damien tournoud’s picture

Yep, there is obviously a bug with the theme you are using, not with Drupal itself.

Upon testing, none of the default themes have this problem. Please reassign that issue to the theme that has problem, or close that issue.

hass’s picture

This is NOT a bug in the theme i'm using. Core does not assign the class to the link.

damien tournoud’s picture

Status: Active » Closed (won't fix)

Core does not assign the class to the link.

Of course not, because core assign the active class to a link *only if* the link point to the current page.

So this is not a bug. Marked as won't fix.

hass’s picture

Status: Closed (won't fix) » Active

Whatever you think, please keep this case active - it's a bug or a not implemented feature - however you'd like to name it.

A tab item that is a top-level item should be kept active as long as we click thru the sub-items of this top level item. This is how the menu works well and how tabs should work, too.

kylehase’s picture

hass, I have the same problem. Neither the li nor a elements of a parent menu item include a unique attribute such as "active" with which CSS can identify. The menu item of the current node is tagged as class="active".

Here's my html output. The "primary" div includes primary links and the "primary-sub1" are the first sub level of my primary links.

<div id="primary">
  <ul class="links"><li class="menu-179 first"><a href="/drupal-work/en/presidents-message" title="About">About</a></li>
<li class="menu-177 last"><a href="/drupal-work/en/logout" title="">Logout</a></li>
  </ul>
</div> <!-- /#primary -->
<div id="primary-sub1">
   <ul class="links"><li class="menu-180 first"><a href="/drupal-work/en/presidents-message" title="A message from our CEO">President&#039;s Message</a></li>
<li class="menu-182 last active"><a href="/drupal-work/en/access-map" title="Access map" class="active">Access Map</a></li>
   </ul>
</div>

While it may not be a bug per say, it's a useful feature.

pwolanin’s picture

Status: Active » Fixed

A fix for this will already be in 6.3: http://drupal.org/node/249571#comment-848993

note that the class that will stick is "active-trail", not "active" since Drupal only uses that for the current page.

hass’s picture

Status: Fixed » Closed (duplicate)

THX for the link. Should be a duplicate then...

kylehase’s picture

Great!

ddaniel.gomez’s picture

Hi all.
I have a similar problem. I have my navigation menu with links to taxonomy term page.
This pages I themed with views; I add a tabs in order to sort the results.

The question is imposible mantain 'active' the item in menu! Only in the default tab is active. Any ideas? I read thousands of post, and nobody have the same problem?

I try some differents ideas, and nothing to do.

Forgive me, but I need your help.

Thanks! and excuse my english :(

ddaniel.gomez’s picture

Nobody with the same problem?
I think it´s not so strange, to need active the current menu item when you navigate between tabs (it´s the same page!!). True, is not the same uri, but the path is ever the same!

www.sample.com/taxonomy/term/%
www.sample.com/taxonomy/term/%/newest
www.sample.com/taxonomy/term/%/by-author
www.sample.com/taxonomy/term/%/on-sale

Come on, I´m so sad; Nothing to found. I see something about primary & secondary links (like a tabs), but nothing util to mantain the active item in navigation menu.

Thanks in advance.

ddaniel.gomez’s picture

Well, maybe this is not the site to post this question, sorry, but my english don´t give for more.

Any ideas? any place to explore any solution?

Thanks again.