Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Menu Trail By Path

Security covered Under active development 32,409 sites

This module automatically highlights menu items that match the current page's URL. It's useful for creating nested menu structures without manually adding all content to the menu, and it works with various page types beyond just nodes.

Menu Trail By Path sets the active-trail on menu items according to the current url.

For example if you are at yoursite.com/blog/category1/article1
Menu Items with these paths will get the active-trail class on them and expand accordingly.

blog
blog/category1
blog/category1/article1

This is particularly useful if you want a lot of nodes to appear as children of certain nodes / taxonomy term / views / referenced nodes / etc, but do not want to add them all to the menu. eg. hundreds of blog articles.

Menu Trail By Path is best used in conjunction with Pathauto.

This module is similar to Menutrails (D6) and Menu Position (D7), except no configuration is needed. It uses the path URL to determine the active-trail instead of setting rules for each node type. It also works for non-node pages such as taxonomy term and views. Just enable the module to see the results.

Drupal 8

  • Make sure to use a "menu.html.twig" like the classy-theme (or use that as base theme, like bartik does), stable-theme and stark-theme will not add the classes that you propably will expect, see "No active trail class gets added"-issue.
  • The module now has some settings for performance optimizations, see release notes for 8.x-1.2

Drupal 7

  • can also handle breadcrumb by path
Drupal 9–11

Ask your assistant about Menu Trail By Path

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

2 tracked projects depend on this one

Activity

Tracked releases
4
Tracked since
Nov 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
2.2.0 Stable 9–11 May 15, 2025
2.1.1 Stable 9–11 Jan 13, 2025
2.1.0 Stable 9–11 Aug 22, 2024
2.0.1 Stable 8–10 Nov 29, 2023