tb-megamenu-item.html.twig in The Better Mega Menu 8
{% set linkAttributes = link['attributes'] %}
{% if ( link['url'] is defined and link['url'] is not empty ) %}
{% set tag = "a" %}
{% set href = " href='#{ link['url'] }'" %}
{% else %}
{% set tag = 'span' %}
{% set href = '' %}
{% set linkAttributes = linkAttributes.addClass('tb-megamenu-no-link').setAttribute('tabindex', '0') %}
{% if submenu is empty %}
{% set linkAttributes = linkAttributes.addClass('tb-megamenu-no-submenu') %}
{% endif %}
{% endif %}
<li {{ attributes }} >
<{{ tag }}{{ href|raw }} {{ link['attributes'] }}>
{% if item_config['xicon'] %}
<i class="{{ item_config['xicon'] }}"></i>
{% endif %}
{{ link.title_translate|t }}
{% if submenu and block_config['auto-arrow'] %}
<span class="caret"></span>
{% endif %}
{% if item_config['caption'] %}
<span class="mega-caption"> {{ item_config['caption']|t }}</span>
{% endif %}
</{{ tag }}>
{{ submenu }}
</li>
File
templates/tb-megamenu-item.html.twig
View source
- {% set linkAttributes = link['attributes'] %}
- {% if ( link['url'] is defined and link['url'] is not empty ) %}
- {% set tag = "a" %}
- {% set href = " href='#{ link['url'] }'" %}
- {% else %}
- {% set tag = 'span' %}
- {% set href = '' %}
- {% set linkAttributes = linkAttributes.addClass('tb-megamenu-no-link').setAttribute('tabindex', '0') %}
- {% if submenu is empty %}
- {% set linkAttributes = linkAttributes.addClass('tb-megamenu-no-submenu') %}
- {% endif %}
- {% endif %}
- <li {{ attributes }} >
- <{{ tag }}{{ href|raw }} {{ link['attributes'] }}>
- {% if item_config['xicon'] %}
- <i class="{{ item_config['xicon'] }}"></i>
- {% endif %}
- {{ link.title_translate|t }}
- {% if submenu and block_config['auto-arrow'] %}
- <span class="caret"></span>
- {% endif %}
- {% if item_config['caption'] %}
- <span class="mega-caption"> {{ item_config['caption']|t }}</span>
- {% endif %}
- </{{ tag }}>
- {{ submenu }}
- </li>