Menu block template doesn't provide the menu name at all

Created on 10 August 2014, over 10 years ago
Updated 30 January 2024, 10 months ago

Problem/Motivation

There's no menu specific identifier in the menu blocks and for that reason theming menu blocks might be hard.
Note: This is the tools menu.

<div class="block block-system block-menu" id="block-atdknkh9" role="navigation">
  
      <h2>mR0u20MI</h2>
    

  <div class="content">
          <ul class="menu">
    <li class="leaf"><a href="/test_page_display_menu_link" data-drupal-link-system-path="test_page_display_menu_link">New title</a></li>

  </ul>
      </div>
</div>

Proposed resolution

Discuss wheter we should have a menu specific class on menu blocks or not.

Remaining tasks

User interface changes

API changes

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component
Menu system 

Last updated 1 day ago

Created by

🇩🇪Germany dawehner

Live updates comments and jobs are added and updated live.
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.

  • 🇳🇿New Zealand danielveza Brisbane, AU

    menu_name is available in menu templates, so you can easily add this by overriding menu.html.twig in your theme or via preprocessing.

    The question is should core add this by default rather than relying on the user to add this themselves. This is a 9 year old task without much traction, so bumping it for visibility and to see if people have thoughts on if we should do this or not.

  • Status changed to Needs review 10 months ago
  • 🇮🇳India rupeshghar

    In the latest version of Drupal, the menu machine name is now included as a class for menus, providing a means to uniquely identify each menu.

  • Status changed to Postponed: needs info 10 months ago
  • 🇺🇸United States smustgrave

    @dawehner are you still seeing this issue?

Production build 0.71.5 2024