Menu system should provide a default tab if none exists

Created on 22 September 2013, almost 11 years ago
Updated 1 July 2024, 2 months ago

Problem/Motivation

Some settings pages have default tabs. We recently introduced default tabs on config entities at all times in #2085907: Ensure all configuration entities have an Edit/Configure tab by default , but that is not true for general settings pages. It is hard in core and contrib to extend settings pages, because you never can be sure if it already has an edit tab or not and may need to add one of your own. Eg. 'Account settings' has a default 'Settings' tab because it expects if you have Field UI module enabled, it would add more tabs on it. If that would not be the case, it would not have a default 'Settings' tab. Now if you look at Site information or RSS settings, those don't *expect* additional tabs, so they don't have a default tab.

This is wrong.

Making core assumptions about which pages may be extended in contrib, so those where this expectation was not there may end up contrib modules trying to add default tabs with different paths/labels, etc. is a problem.

Proposed resolution

The tab system should be intelligent enough that if there is no default tab, it should add one. It could take the label (and sub-path segment) of that from the parent route with a new syntax. Alternatively people need to manually define a default tab at all times on all routes.

Remaining tasks

Decide if we can/want to autogenerate or want to go manual.

User interface changes

No ui changes for core. Enabling contrib modules that want to add more tabs will make the default tab show up. However until such a module is enabled, the default tab would not show.

API changes

Figure out.

Related Issues

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Menu system 

Last updated 1 day ago

Created by

🇺🇸United States YesCT

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

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.

Production build 0.71.5 2024