bootstrap_storybook-8.x-2.0/src/components/field/field--tags.twig
src/components/field/field--tags.twig
{#
/**
* @file
* Template for field_tags.
*/
#}
{%
set classes = [
'field',
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
]
%}
{%
set title_classes = [
'field__label',
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes.addClass(classes, 'field__items') }}>
{% for item in items %}
<div{{ item.attributes.addClass('field__item') }}>
{% include '@bootstrap_storybook/badge/badge.twig' with {
type: 'light',
content: item.content['#title'],
url: item.content['#url'],
} %}
</div>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<div{{ attributes.addClass(classes, 'field__item') }}>
{% include '@bootstrap_storybook/badge/badge.twig' with {
type: 'light',
content: item.content['#title'],
url: item.content['#url'],
} %}
</div>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes.addClass(classes) }}>
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% if multiple %}
<div class="field__items">
{% endif %}
{% for item in items %}
{% include '@bootstrap_storybook/badge/badge.twig' with {
type: 'light',
content: item.content['#title'],
url: item.content['#url'],
} %}
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</div>
{% endif %}
