Skip to content

Commit

Permalink
Template for K-centre URL field
Browse files Browse the repository at this point in the history
  • Loading branch information
andmor- committed Sep 30, 2024
1 parent b7bde73 commit 28d130f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions templates/field/field--field-k-centre-website-url.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{%
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 %}
{% for item in items %}
<div{{ attributes.addClass(classes, 'field--item btn btn-outline-primary') }}>{{ item.content }}</div>
{% endfor %}
{% else %}
<div{{ attributes.addClass(classes) }}>
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% for item in items %}
<div{{ item.attributes.addClass('field--item') }}>{{ item.content }}</div>
{% endfor %}
</div>
{% endif %}

0 comments on commit 28d130f

Please sign in to comment.