The attached image illustrates some remaining tab problems.

CommentFileSizeAuthor
#3 menu_2.patch5.6 KBJonBob
tab-problems.png31.45 KBDries
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JonBob’s picture

Assigned: Unassigned » JonBob

Thanks. Will investigate.

JonBob’s picture

Here are the diagnoses as I see them:

1) The code marks as "active" all links that are in the trail from "Home" to the current page. This means that when visiting a non-default tab, the default tab is redundantly marked as active. This was introduced by my patch to refactor the theming of tabs and allow weighting.

2) The weighting patch also makes it possible for default tabs to appear in a location other than the far left.

3) Book pages behave strangely because there are two paths for each page, "node/52" and "book/view/52". When you view a book page with the latter URL, no tabs appear at all because they are attached to the "node" location.

4) When viewing book pages with the "node" path instead, the correct tabs are displayed but none are selected. This is because book pages use menu_set_location() to make sure the breadcrumb trail and menu reflect the node's location within the book. This happens after the _menu() hook defines the tabs, but before the current tab is determined.

5) It is possible for no subtab to be selected. The default tab is generated automatically from the parent item, so we can select it if no others are selected, but the same is not done for subtabs. We could do this, but then the default subtab would share the same name as the selected tab unless we figure out some other place to define the subtab name.

6) I don't yet know why there are sometimes two sets of subtabs.

JonBob’s picture

FileSize
5.6 KB

This patch fixes issues 1, 2, 4, and 6. The other two issues require further discussion.

Dries’s picture

Committed to HEAD. Thanks.

I'll give the remaining issues some thought so this can be discussed shortly. Marking this 'active'.

JonBob’s picture

A recent patch fixed #5. The book module is still quite strange in that it has two paths for viewing nodes. For now, I'm going to say this is the fault of the module and not the menu system; marking this fixed.

Anonymous’s picture