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:
- Menu: Select which menu the vocabulary's terms should appear under
-
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).
- 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.
- Display Number of Nodes: Displays the number of nodes next to the term in the menu.
- Hide Empty Terms: Does not create menu links for terms with no nodes attached to them.
- 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.
- Auto Expand Menu Item: Enables the 'Expand' option when creating the menu links. This is useful if using suckerfish menus in the primary links.
- 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.
- 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
- Go to Site building > Menus
- Create a new menu, go to Site building > Blocks and enable it.
- 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
- View a list of taxonomies in administer >> taxonomy (admin/taxonomy).
- Create a new vocabulary at administer >> taxonomy >> add vocabulary. (admin/taxonomy/add/vocabulary)
- Administer taxonomy_menu settings by going to administer >> settings >> taxonomy menu. (admin/settings/taxonomy_menu)
- File issues, read about known bugs, and download the latest version on the Taxonomy menu project page.
NOTES
- Menu Items are Path Alias aware and compatible with PATHAUTO.
- The router item must be created before Taxonomy Menu creates the links. Failure to so will cause the menu items to not be created.
- Router items can be created by either a view or another modules hook_menu.
- If using PathAuto, the URL passed to the code it taxonomy/term/$tid.
- Advanced Breadcrumbs can be controled by Taxonomy Breadcrumb (http://drupal.org/project/taxonomy_breadcrumb)
- Changing the taxonomy default URL to match the custom Taxonomy Menu Path can be controlled by Taxonomy Redirect (http://drupal.org/project/taxonomy_redirect)
- 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.
- Use hook_term_path to define a custom taxonomy path. Taxonomy Menu and PathAuto will honor the paths.