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

Created on 10 August 2014, almost 11 years ago
Updated 19 April 2023, about 2 years 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

Active

Version

10.1

Component
Menu system 

Last updated 7 days 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 over 1 year 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 over 1 year ago
  • 🇺🇸United States smustgrave

    @dawehner are you still seeing this issue?

  • Status changed to Closed: outdated 23 days ago
  • 🇳🇿New Zealand quietone

    Based on the last comments, I am closing this issue.

Production build 0.71.5 2024