Taxonomy terms allow classification of content into categories and subcategories. The Taxonomy Menu module adds links to the navigation menu for taxonomy terms. This is useful when the community is focused on creating content that is organized in a taxonomy.

Creating a Taxonomy Menu

In order to create a taxonomy menu, first create your vocabulary. If you have an existing vocabulary, navigate to the taxonomy administration menu. The path depends on your Drupal version (5, 6, or 7).

For 7.0x-1.0+
You can create a taxonomy menu by visiting the following:
http://www.example.com/admin/structure/taxonomy/{your vocabulary}/edit

For example, if your vocabulary name is, "product_categories", your path to it would be the following:
http://www.example.com/admin/structure/taxonomy/product_categories/edit


Instructions for 6.x-2.0+

Taxonomy Menu does not handle the menu call backs. It only creates the links in the menus. This means that whatever is displayed on the page (title, content, breadcrumbs, etc.) is no longer controlled by Taxonomy Menu. While this is different than the previous versions, it gives you a lot more control over the page content. No longer do you have to hack the module to change how you would like something displayed.

Configuration

All configuration options are on the vocabulary's edit screen
(http://www.example.com/admin/content/taxonomy/edit/vocabulary/$vid)

Options:

  1. Menu: Select which menu the vocabulary's terms should appear under
  2. Menu Path Type: Select how the URL for the term path should be created.
      Included:
    • Default: The URL for the term is set to 'taxonomy/term/tid'. If you have 'Item for Vocabulary' selected then the path is 'taxonomy/term/tid tid tid' (all of the tid's for the vocabulary.
    • Hierarchy: This should only be used if you have custom code or a block that relies on the category/vid/tid/tid/tid. If you would like the URL to be this path, the recommendation is to use PathAuto with 'category/[vocab-raw]/[catpath-raw]'. Use the field "Base Path for Hierarchy Path" to set the base URL that will match the view or page callback. The view or page callback MUST be created before the taxonomy menu.
    • Custom: Creates a custom base for each vocabulary. Useful if you would like a different path or view for each vocabulary. See the 'Views' section below for more information about views.
    • Extensible by using new Hook: See developers documentation for more information (http://drupal.org/node/380652).
  3. Synchronize changes to this vocabulary: If selected, the menu will auto update when you change a node or term. Recommend to always have this selected.
  4. Display Number of Nodes: Displays the number of nodes next to the term in the menu.
  5. Hide Empty Terms: Does not create menu links for terms with no nodes attached to them.
  6. Item for Vocabulary: Create a menu link for the vocabulary. This will be the parent menu item. The path depends on what you selected in for the Menu Path. See above for the default.
  7. Auto Expand Menu Item: Enables the 'Expand' option when creating the menu links. This is useful if using suckerfish menus in the primary links.
  8. Display Descendants: Alters the URL to display all of child terms. /$tid $tid $tid $tid. When this is set, the Path Alias is not applied.
  9. Select to rebuild the menu on submit: Deletes all of menu items and relationships between the menu and terms and recreates them from the vocabulary's terms. This will create new mlid's for each item, so be careful if using other modules to extend the menu functionality.

Views Integration suggestions.

VIEWS WITH MENU PATH TYPE: DEFAULT

  • The default view is 'taxonomy_term (default)'.
  • The path of the view is 'taxonomy/term/%', the argument is 'Term ID (with depth)' and 'Depth Modifier' - but only TERM ID will be passed as an argument. This view can be changed - but it is recommended to use the option MENU PATH TYPE: CUSTOM for individual views.

VIEWS WITH MENU PATH TYPE: CUSTOM

  • You need to have a view with path 'custom path/%' and an argument 'Term ID' before you create the taxonomy menu.
  • To use the 'Display Depth in Custom Path:' option, the path in the view has to be 'custom path/%/%'"
  • The two arguments must be 'Term ID (with depth)' and 'Depth Modifier'. Have this view setup before you create the taxonomy menu.

Instructions for 5.x

The taxonomy menu administration interface allows taxonomy terms to be enabled to be shown in the navigation menu. You can also select whether a term's descendants subterms are displayed.

Getting a menu block to show with Taxonomy terms.

To get your own block, you have to move the category menu item to its own menu. Taxonomy menu puts this new menu in the Navigation menu by default

  1. Go to Site building > Menus
  2. Create a new menu, go to Site building > Blocks and enable it.
  3. Go back to Menus and move the item(s) you want in the new block by editing them and selecting the new menu as the parent.

You can

  1. View a list of taxonomies in administer >> taxonomy (admin/taxonomy).
  2. Create a new vocabulary at administer >> taxonomy >> add vocabulary. (admin/taxonomy/add/vocabulary)
  3. Administer taxonomy_menu settings by going to administer >> settings >> taxonomy menu. (admin/settings/taxonomy_menu)
  4. File issues, read about known bugs, and download the latest version on the Taxonomy menu project page.

NOTES

  1. Menu Items are Path Alias aware and compatible with PATHAUTO.
  2. The router item must be created before Taxonomy Menu creates the links. Failure to so will cause the menu items to not be created.
  3. Router items can be created by either a view or another modules hook_menu.
  4. If using PathAuto, the URL passed to the code it taxonomy/term/$tid.
  5. Advanced Breadcrumbs can be controled by Taxonomy Breadcrumb (http://drupal.org/project/taxonomy_breadcrumb)
  6. Changing the taxonomy default URL to match the custom Taxonomy Menu Path can be controlled by Taxonomy Redirect (http://drupal.org/project/taxonomy_redirect)
  7. When using the CCK 'Content Taxonomy' module the field option Save values additionally to the core taxonomy system (into the 'term_node' table)' has to be enabled. Otherwise nodes with taxonomy terms linked through this field will not be shown within the menu structure that Taxonomy Menu creates.
  8. Use hook_term_path to define a custom taxonomy path. Taxonomy Menu and PathAuto will honor the paths.

Comments

jadragna’s picture

Every time I edit my vocabulary [/admin/content/taxonomy/edit/vocabulary/#] that is utilizing the Taxonomy Menu a new item is added to my menu called [vocab name]. These are also added to my menus list [at admin/build/menu-customize/primary-links] and I'm unable to delete them. My only option is to uncheck the enable box. What gives? In the edit page this is what I have checked: Menu Location > Primary Links, Menu Path Type > Default, Synchronise Changes, Add item and Auto expand. I've experimented with changing a few of these only to have more and more [vocab name]'s appear in my menu and list of primary links. I'm running Drupal 6.

mtundu2’s picture

Has anyone figured out what the problem is here? The only apparent solution is to go into the database and start deleting these random menu items, however, that doesn't solve the long term problem.

sasilk’s picture

To remove these, go into the Menu menu item and click on the Edit link for the orphan. Look at the URL that's in your browser address bar and change the part (usually at the end) that says 'edit' to 'delete' and hit Enter. You will get a page asking you to confirm the deletion.

BoogieBug’s picture

Seem that the menu item generated by the Taxonomy Menu cannot be deleted via the UI. I have to delete it from the table 'menu_links' directly.

giorgio79’s picture

What is a router item mentioned in this book page?

jjmontgo’s picture

Is it possible to have the menu display shorter URLs?

For example, http://domain.com/taxonomy-term?

Is there a tutorial explaining how to do this?

devkinetic’s picture

Sure thing. Set your menu type to custom and put 'term' in the base path

Ryan aka Devkinetic
Sr. Web Developer

samjbobb’s picture

When using a custom path (at least without the depth option) you should not have the "/%" after the path in the view or the Taxonomy menu. Comment #8 here explains it: http://drupal.org/node/568220

moniuch’s picture

Is this discontinued for D7? How do you get the same functionality in D7?

nielsonm’s picture

If you go to the project page http://drupal.org/project/taxonomy_menu, the module's available for D7.

"The most incomprehensible thing about the world is that it is comprehensible."
-Einstein

boiky’s picture

The huge part of functionality is not available on D7. The most important probably being:
"Display Number of Nodes: Displays the number of nodes next to the term in the menu."

I suppose this functionality is in 2nd branch, which is only available for D6, as D7 last version is 1.2
I see that there isn't even 2x-dev version in D7, only 1x-dev.

David,
are there any plans to merge all these features to D7?

dzah’s picture

None of the following options seems to be available for Drupa 7
All these functionality is very needed.
Are there any plans to add it?

Synchronize changes to this vocabulary
Display Number of Nodes
Hide Empty Terms
Item for Vocabulary
Auto Expand Menu Item
Display Descendants

BrianLP’s picture

Any update on these functions?

firebird’s picture

Yes, see here: http://drupal.org/node/1192084.

You can either apply the appropriate patch yourself, or use the latest dev version of the module.

hmartens’s picture

I used the "7.x-1.2" version on Drupal 7.12 but it doesn't give me the options for expand menu etc. So I installed the "7.x-1.x-dev" version that gives me the options but still doesn't help me at all. There's no difference whether I use "Auto expand menu items" or not...and the "Add item for vocabulary" is great out, I can't select this option... and I can't add anything in "Custom name for vocabulary item"...

Maybe I'm missing something because I can't get it displaying right...I want a menu item called "Category" which is my taxonomy term and then when I press that it drops down a menu with all the terms listed under Category...

Please help..and thank you :)

Living life in a grande way.

traceh38’s picture

Hello, the locations of the Taxonomy menu options are not immediately evident does not seem to be located at structure/taxonomy/vocabulary/edit Is it located elsewhere in drupal 8

kostask’s picture

According to https://www.drupal.org/node/2766273 this functionality does not seem to have been ported yet.

2Geckos’s picture

Only first level of the menu is working, is is just me?