Drupal is a registered trademark of Dries Buytaert

The Auto Taxonomy Menu module automatically generates dynamic child menu items for a parent menu link based on taxonomy terms in use by a specific content type. This is particularly useful for building navigation like "Articles by Topic" or "Products by Category" where the menu should automatically update as content is tagged with new terms, without requiring manual menu management.

Features

  • Dynamic Derivation: Menu links are generated on-the-fly during menu rebuilds.
  • Content-Aware: Only terms that are actually assigned to nodes of the selected content type will appear in the menu.
  • AJAX Configuration: Seamlessly integrated into the standard Drupal menu link edit form.
  • Flexible URLs: Supports URL templates with a %term placeholder (e.g., /articles/%term).
  • Cache Integration: Automatically triggers menu rebuilds when relevant content is created, updated, or deleted.

Post-Installation

This module is particularly well suited for menu items generated by the Views module that contain a relationship and contextual filter on a taxonomy vocabulary.

This view will then generate the required routes that auto_taxonomy_menu expects. The routes might be something like /[ContentType]/[Term]

Creating a compatible view

1. Create or edit a view for one of your content types

Add a relationship to a Taxonomy Term

2. Under the Relationship section on the right, click the Add button
3. Search for Taxonomy terms on node and check its box
4. Click Apply (On all Displays) button

Configure the relationship

5. Select the Vocabulary that your content type uses
6. Leave Require this relationship turned off as this will allow your view to be shown for ALL topics when no topic is specified

Add a Contextual filter

7. Under the Contextual filters section on the right, click the Add button
8. Search Name and select the Name option with the Taxonomy Term category and check its box
9. Click Apply (On all Displays) button

Configure the Contextual filter

10. Make sure the relationship is set to the Vocabulary you chose in the relationship section
11. Under When the filter value is NOT in the URL, Select Display all results for the specified field

  1. Under Exceptions, set Exception value to All

12. Under When the filter value IS in the URL or a default is provided:

  1. Enable and set Override Title to {{ arguments.name }} [Name of your Content Type in Plural]
  2. Enable and set Specify validation criteria to Taxonomy Term Name
  3. Set the vocabulary to the one you configured in the relationship
  4. Enable Transform dashes in URL to spaces in term name filter values

13. Click Apply (On all Displays) button

Configure the Contextual filter Aggregation Settings

If you do not do this part, your view will have duplicate items when your content has more than one Term associated with it.

14. Click Aggregation Settings under Contextual Filter section
15. Set Aggregation type to Group results together
16. Click Apply

Enabling Auto Taxonomy Menu on a Menu Item

17. Edit any menu link (e.g., "Articles").
18. Locate the Auto Taxonomy Menu fieldset.
19. Check Enable auto-generated child links.
20. Select the Content Type (e.g., Article) and the Taxonomy Vocabulary it uses.
21. Provide a URL Template starting with / and containing the %term variable (e.g., /articles/%term).

  • Note: Spaces in term names are automatically converted to dashes for the URL (e.g., "Sound Mind" becomes "Sound-Mind").
  • This template should match the path that you configured in your view

22. Save the menu link.

When you are redirected to the Menu page, you should see that your menu item now has new children generated by Auto Taxonomy Menu. (If theres any relevant content that is tagged).

Now, whenever content is tagged with the configured topic, the topic will appear as a child menu item.

Supporting this Module

A lot of hard work and dedication has gone into developing this module. If you find it helpful and would like to support ongoing development, consider buying me a coffee! Your support helps ensure that I can continue enhancing and maintaining this module for everyone. Thank you for your generosity!

Technical Architecture

- Hook System (AutoTaxonomyMenuHooks): Manages the form alterations, validation, and database storage for configurations. It also listens to entity events to invalidate the router cache.
- Plugin Deriver (AutoTaxonomyMenuLink): A menu link deriver that queries the database for unique taxonomy terms associated with the configured content type and generates the PluginDefinition arrays.
- Database Table: auto_taxonomy_menu_links stores the mapping between menu link IDs and their taxonomy generation settings.

Similar Modules

Taxonomy Menu

Taxonomy Menu allows you to create a menu based on a Taxonomy Vocabulary alone and that is it. The problem is, if you share this vocabulary among multiple content types, the taxonomy listings will list them together and this may not be what you desire.

Whereas, Auto Taxonomy Menu generates menu items based on a combination of SPECIFIC content type and vocabulary. This is useful when you have a vocabulary that is shared between content types, such as News by Topic and Blogs by Topic. Using Auto Taxonomy Menu, you can have menus that list the relevant topics for each content type and link to only that content type. When generating menu links for Auto Taxonomy, the module will make sure that a content item of the specified type exists with the Taxonomy Term before adding the term to the menu. Thereby preventing any links to terms that don't have associated content of that type.

The power of Auto Taxonomy Menu shines when combined with Views configured with a Relationship and Contextual Filtering on a term.

Troubleshooting

No menu links are created

Things to check for:

  • Make sure that you actually have some content items that are tagged with terms from the selected vocabulary.
  • Make sure there are valid routes for the urls generated by your URL template
    • Turn on debug logging and check the drush watchdog:show for items like "auto_taxonomy_menu Warning Could not create the link MyTerm. /myroute/MyTerm has no corresponding route. "
    • If this is the case you will need to either configure a view as we show above to generate those routes or generate them some other way.

Activity

Total releases
1
First release
Feb 2026
Latest release
1 month ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Feb 1, 2026