You are here

we-megamenu-li.html.twig in Drupal Mega Menu 8

Same filename and directory in other branches
  1. 8.x templates/we-megamenu-li.html.twig
<li {{ attributes }}>
  {% if href is empty %}
    <a href='#' data-drupal-link-system-path="<front>" class="we-megamenu-nolink">
      {% if (attribute(attributes, 'data-icon') is defined and attribute(attributes, 'data-icon')|trim) %}
        <i class="{{ attribute(attributes, 'data-icon') }}"></i>
      {% endif %}

      {{- title -}}
    </a>
  {% else %}
    <a class="we-mega-menu-li" title="{{ attribute(attributes, 'description') }}" href="{{ href }}" target="{{ attribute(attributes, 'data-target') }}">
      {% if (attribute(attributes, 'data-icon') is defined and attribute(attributes, 'data-icon')|trim) %}
        <i class="{{ attribute(attributes, 'data-icon') }}"></i>
      {% endif %}

      {{- title -}}

      {% if (attribute(attributes, 'data-caption') is defined and attribute(attributes, 'data-caption')|trim) %}
        <span class="we-mega-menu-caption">{{ attribute(attributes, 'data-caption') }}</span>
      {% endif %}
    </a>
  {% endif %}
  {{ content }}
</li>

File

templates/we-megamenu-li.html.twig
View source
  1. <li {{ attributes }}>
  2. {% if href is empty %}
  3. <a href='#' data-drupal-link-system-path="<front>" class="we-megamenu-nolink">
  4. {% if (attribute(attributes, 'data-icon') is defined and attribute(attributes, 'data-icon')|trim) %}
  5. <i class="{{ attribute(attributes, 'data-icon') }}"></i>
  6. {% endif %}
  7. {{- title -}}
  8. </a>
  9. {% else %}
  10. <a class="we-mega-menu-li" title="{{ attribute(attributes, 'description') }}" href="{{ href }}" target="{{ attribute(attributes, 'data-target') }}">
  11. {% if (attribute(attributes, 'data-icon') is defined and attribute(attributes, 'data-icon')|trim) %}
  12. <i class="{{ attribute(attributes, 'data-icon') }}"></i>
  13. {% endif %}
  14. {{- title -}}
  15. {% if (attribute(attributes, 'data-caption') is defined and attribute(attributes, 'data-caption')|trim) %}
  16. <span class="we-mega-menu-caption">{{ attribute(attributes, 'data-caption') }}</span>
  17. {% endif %}
  18. </a>
  19. {% endif %}
  20. {{ content }}
  21. </li>