Active trail should favor "non-customized" menu items

Created on 28 December 2012, over 12 years ago
Updated 3 September 2025, 14 days ago

When multiple menu items point to the same page, the active trail is often not the intended one. This happens a lot. It is very difficult that a breadcrumb and a URL are singular but a menu item can be multiple.

The trouble comes in menu_link_get_preferred. Various solutions have been presented such as preferring the item that is most deeply nested #306412: Get the deepest menu entry when more than one entry points to the same content β†’ or by having multiple active trails #609542: Active trail isn't set on all menu items pointing to the current path β†’ .

One simple improvement I think we should make is to, for a node, favor the per-node menu settings over the 'customized' menu items made via menu administration. Because only one menu item can be made on a node form, treating this item as canonical relative to active trail (like we treat its path alias setting there as canonical) makes a lot of sense and is easy for editors to understand.

What we currently have is no real ordering of which menu item to prefer in an active path, so adding a bit of ordering that makes sense to users seems like a big step forward. And also a one line patch. Creds to Timmy P.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

menu system

Created by

πŸ‡ΊπŸ‡ΈUnited States Jody Lynn

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024