emulsify icon indicating copy to clipboard operation
emulsify copied to clipboard

Menu links not getting Drupal's link attributes

Open evanmwillhite opened this issue 6 years ago • 1 comments

Looks like the menu link itself is a non-Twig template straggler leftover from D7 days of yore. This means, that when we do this instead of using {{ link(item.title, item.uri) }} we lose any of Drupal attributes goodness (title, rel, data-drupal-link-system-path, etc.). We wanted to get away from this with the BEM function, so we need to rewrite this to be something like this:

{% set link_title %}
  {# any icons, etc. can go here #}
  {{ item.title }}
{% endset %}
{{ link(link_title, item.url, { 'class':[bem(item_base_class|default(menu_class ~ '__link'), item_modifiers)]} ) }}

☝️ Untested, but you get the idea.

evanmwillhite avatar Feb 05 '19 17:02 evanmwillhite

It seems like the context isn't correct here or something. I'm using Menu Link Additions module to add classes to specific menu items but they aren't showing.

ace4it avatar May 13 '19 15:05 ace4it