1

My site (running D7) is divided into four sections to organise its content. This is implemented via a taxonomy vocabulary, and my main menu lists each term in this vocabulary. So when a user clicks a main menu item, it is highlighted and all articles in that section (nodes with that term) are shown. Brilliant.

But, when a user then clicks one of these articles to view the whole thing, the main menu item is no longer highlighted. Although the article does display the taxonomy term, I would very much like to keep the main menu item highlighted so it's obvious to the user which section she's browsing.

How can I achieve this?

Edit: Clarified that I'm using Drupal v7. Also, managing the menu itself is not a goal (that's easy enough), the goal is only keeping the menu highlighted when viewing an article node as opposed to the term node.

0

You can use Taxonomy Menu module. I've used it on one site, and it works ok. It allows you to create menu automatically based on your taxonomy vocabulary. It puts all your content tagged with term under term's menu. One tricky thing is, that it works on changing or creation of terms - when you just turn module on, it will seems not to work.

  • One tricky thing Ooh, that is interesting. I shall try to edit my nodes and see. Thanks, @Marcin! – KlaymenDK Sep 1 '11 at 7:44
  • @KlaymenDK try check classes in your menu. It should be some differences between menu item you want highlight and others. – Marcin Wosinek Sep 1 '11 at 10:15
  • I just tried installing this module. I see what it does in terms of creating menu items for a taxonomy vocabulary, but it doesn't do what I want in terms of menu highlighting for specific nodes (note the actual terms but articles using those terms). Maybe this module is solving a different problem, or maybe the docs aren't clear (they're only for D6, I'm on D7), but I won't call this a success. Please speak up if I've missed something! – KlaymenDK Sep 1 '11 at 10:17
  • I did notice that I suddenly had twice the number of menu items, and I did disable my manually created ones, leaving only those generated by Taxonomy Menu. This seems to work, but I'm wondering if it solves a different problem than my question. – KlaymenDK Sep 1 '11 at 10:24
1

I'm sure there is a better way to do it but the context module will allow this.

You can set up a condition for each term which sets the menu item as the reaction.

  • Thanks! Little more help? I've configured a context so that on the condition that "Taxonomy" points to one of my section terms (with "Set on node form", although I have no clue what this means), the reaction is that "Menu" points to the corresponding menu. When I then select an article in that section, the menu is still not highlighted. Am I missing something? I also needed to install the "Menu block" and "Context: Menu block" modules, and they're enabled. – KlaymenDK Aug 11 '11 at 13:12
  • 1
    That should work. I'll try to test locally. – Jeremy French Aug 11 '11 at 15:25
  • That's awfully nice of you. I hope to hear from you again, but don't rush too much for my sake. – KlaymenDK Aug 11 '11 at 18:26
  • Hey @Jeremy French, any news? – KlaymenDK Aug 28 '11 at 12:48
0

You can use Taxonomy Menu and Taxonomy Menu Trails by setting Term references for setting active trail when editing content type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.