I am trying to figure out how to make multiple items in a menu show as active. I have a primary menu that is a hierarchy of taxonomy vocabulary and terms, e.g.
Taxonomy Vocabulary A
--Taxonomy Term X
--Taxonomy Term Y
Taxonomy Vocabulary B
--Taxonomy Term Z
The vocabulary menu links point to an overview page which is a view that shows a list of the terms under that vocabulary with a side menu that also lists the sub items (using menu_block for this). The terms then link to a view that shows all nodes for the term. There are lots of nodes, so I have not created menu items for the nodes themselves. When I am on the Taxonomy Vocabulary A overview page, the primary menu link for Taxonomy Vocabulary A gets the active class and is highlighted. When I am on the Taxonomy Term X page, the Taxonomy Term X sub-item gets highlighted, but the Taxonomy Vocabulary A link isn't. Similarly, on the node pages, neither the vocab nor the term menu items are highlighted. I want each level down the vocab/term/node tree to have its ancestors lit up.
I have experimented with menu_set_active_trail without any luck. I have successfully used the preprocess functions in my theme to manipulate the links directly, but that doesn't seem like the Drupal way.
At first I thought that it was because there are no menu items for the nodes, but the Term page doesn't light up the vocabulary menu item and those are definitely parent-child in the menu.
Comments
Did you have any luck? I'm
Did you have any luck?
I'm trying to do the exact same thing, I'm quite surprised that nobody else has run into this.
-- George