commercetools-8.x-1.2-alpha1/modules/commercetools_demo/templates/commercetools-locales-block--demo.html.twig
modules/commercetools_demo/templates/commercetools-locales-block--demo.html.twig
{#
/**
* @file
* Theme override to display links as Bootstrap dropdown.
*
* Available variables:
* - header: Text for dropdown toggle button.
* - links: Links to be output.
* Each link will have the following elements:
* - title: The link text.
* - href: The link URL.
* - attributes: (optional) HTML attributes for the anchor.
*
* @ingroup themeable
*/
#}
{% if links %}
<div class="dropdown">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="ctLocaleSwitcher" data-bs-toggle="dropdown" aria-expanded="false">
{{ header }}
</a>
<ul class="dropdown-menu" aria-labelledby="ctLocaleSwitcher">
{%- for item in links -%}
<li>
<a {{ item.attributes.addClass('dropdown-item') }} href="{{ item.href }}">{{ item.title }}</a>
</li>
{%- endfor -%}
</ul>
</div>
{% endif %}
