Commit 6f968b86 authored by markcarver's avatar markcarver

Issue #3017388 by markcarver, lonalore, erlendsl: Missing...

Issue #3017388 by markcarver, lonalore, erlendsl: Missing data-drupal-link-system-path from menu links
parent bb1ce757
...@@ -27,20 +27,23 @@ ...@@ -27,20 +27,23 @@
{% {%
set item_classes = [ set item_classes = [
item.is_expanded and item.below ? 'expanded dropdown', item.is_expanded and item.below ? 'expanded dropdown',
item.in_active_trail ? 'active-trail', item.in_active_trail ? 'active active-trail',
loop.first ? 'first', loop.first ? 'first',
loop.last ? 'last', loop.last ? 'last',
] ]
%} %}
<li{{ item.attributes.addClass(item_classes) }}> <li{{ item.attributes.addClass(item_classes) }}>
{% if menu_level == 0 and item.is_expanded and item.below %} {% set link_title = item.title %}
<a{{ item.link_attributes.addClass(['dropdown-toggle', item.in_active_trail ? 'active-trail']) | without('data-toggle') }} href="{{ item.url }}" data-toggle="dropdown">{{ item.title }}<span class="caret"></span></a> {% set link_attributes = item.link_attributes %}
{% else %} {% if menu_level == 0 and item.is_expanded and item.below %}
<a{{ item.link_attributes.addClass(item.in_active_trail ? 'active-trail') }} href="{{ item.url }}">{{ item.title }}</a> {% set link_title %}{{ link_title }} <span class="caret"></span>{% endset %}
{% endif %} {% set link_attributes = link_attributes.addClass('dropdown-toggle').setAttribute('data-toggle', 'dropdown') %}
{% if item.below %} {% endif %}
{{ _self.menu_links(item.below, attributes.removeClass(classes), menu_level + 1, classes) }} {# Must use link() here so it triggers hook_link_alter(). #}
{% endif %} {{ link(link_title, item.url, link_attributes.addClass(item.in_active_trail ? 'active-trail')) }}
{% if item.below %}
{{ _self.menu_links(item.below, attributes.removeClass(classes), menu_level + 1, classes) }}
{% endif %}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment