You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
903 B
42 lines
903 B
{{ attach_library('rdm/accordion') }} |
|
|
|
{% |
|
set classes = [ |
|
'field', |
|
'accordionjs', |
|
'accordion_block', |
|
'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 %} |
|
<ul{{ attributes }}> |
|
{% for item in items %} |
|
{{ item.content }} |
|
{% endfor %} |
|
</ul> |
|
{% else %} |
|
{% for item in items %} |
|
<div{{ attributes.addClass(classes, 'field-item') }}>{{ item.content }}</div> |
|
{% endfor %} |
|
{% endif %} |
|
{% else %} |
|
<ul id="accordion" {{ attributes.addClass(classes) }}> |
|
{% if multiple %} |
|
{% endif %} |
|
{% for item in items %} |
|
{{ item.content }} |
|
{% endfor %} |
|
{% if multiple %} |
|
{% endif %} |
|
</ul> |
|
{% endif %}
|
|
|