Problem/Motivation
Top-level menu items are rendered by the nav component using the twig link() function, which fully supports attributes, not just the href and class. However, when a menu is nested, the dropdown-menu component directly generates the link, rather than using the twig link() function.
Steps to reproduce
Generate a menu bar with a nested menu item. Provide additional attributes (other than class) in the menu definition. For example:
cocktail.login:
route_name: user.login
title: 'Log in'
weight: 0
description: 'Log in to your account.'
options:
attributes:
class:
- 'use-ajax'
- 'login-popup-form'
data-dialog-type: bootstrap4_modal
data-dialog-options: '{"dialogClasses":"modal-dialog-centered modal-sm"}'
query:
destination: '<front>'
parent: account_menu
Comments
Comment #2
danchadwick commentedHere's a patch to harmonize dropdown-menu with nav with regard to
link().Comment #3
danchadwick commentedComment #5
danchadwick commented