bootstrap_italia-8.x-0.x-dev/templates/region/footer-menu/menu--footer-menu.html.twig
templates/region/footer-menu/menu--footer-menu.html.twig
{#
/**
* @file
* Default theme implementation to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
* - title: The menu link title.
* - url: The menu link url, instance of \Drupal\Core\Url
* - localized_options: Menu link localized options.
* - is_expanded: TRUE if the link has visible children within the current
* menu tree.
* - is_collapsed: TRUE if the link has children within the current menu tree
* that are not currently visible.
* - in_active_trail: TRUE if the link is in the active trail.
*
* @ingroup themeable
*/
#}
{% apply spaceless %}
<div class="row">
{% set col = items|length > 4 ? 3 : 12 / items|length %}
{% for item in items %}
<div class="col-sm-6 col-lg-{{ col }} pb-4 footer-items-wrapper">
<h3 class="h6 text-uppercase">
{% if item.url.external %}
{{ link(
item.title,
item.url,
item.attributes
.addClass(['text-decoration-none', 'text-light'])
.setAttribute('target', '_blank')
.setAttribute('aria-label', item.title ~ ' in new window'|t)
) }}
{% elseif item.url.routeName is null or item.url.routeName == '<nolink>' or item.url.routeName == '<none>' %}
{{ item.title }}
{% else %}
{{ link(item.title, item.url, item.attributes.addClass(['text-decoration-none', 'text-light'])) }}
{% endif %}
</h3>
{% if item.below %}
<div class="link-list-wrapper">
<ul{{ attributes.addClass(['footer-list','link-list','clearfix']) }}>
{% for item_second in item.below %}
<li{{ item_second.attributes.addClass('my-1') }}>
{% include '@bi-bcl/list/linklist-item.html.twig' with {
item: item_second,
list_type: 'footer-menu',
} %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endapply %}
