Skip to content

Commit

Permalink
bugfix for spaces and capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-korf committed Aug 31, 2023
1 parent c45a855 commit 51faea8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/block/block--expandable-content.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

<div class="accordion-item tab-content">
<h2 class="accordion-header" id="ucb-accordion{{ id }}-title{{ loop.index }}">
<a id = "{{ item.entity.field_expandable_content_title.value }}" class="accordion-button{{ not itemExpanded ? ' collapsed' }} expandableHeaders" type="button" data-bs-toggle="collapse" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" aria-expanded="{{ itemExpanded ? 'true' : 'false' }}" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}">
{% set expandableHeaderID = item.entity.field_expandable_content_title|view %}
<a id = "{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="accordion-button{{ not itemExpanded ? ' collapsed' }} expandableHeaders" type="button" data-bs-toggle="collapse" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" aria-expanded="{{ itemExpanded ? 'true' : 'false' }}" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}">
{{ item.entity.field_expandable_content_title|view }}
</a>
</h2>
Expand All @@ -52,7 +53,7 @@
<ul class="nav nav-tabs justify-content-center" id="ucb-horizontal-tabs{{ id }}" role="tablist">
{% for key, item in entity.field_expandable_content_copy %}{% set itemExpanded = loop.first %}
<li class="nav-item" role="presentation">
<a id = "{{ item.entity.field_expandable_content_title.value }}" class="nav-link horizontal-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" data-bs-toggle="tab" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" type="button" role="tab" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
<a id = "{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="nav-link horizontal-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" data-bs-toggle="tab" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" type="button" role="tab" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -64,7 +65,7 @@
<div class="vertical-tab-accordion d-flex align-items-stretch">
<div class="vertical-tabs nav flex-column nav-pills" id="ucb-vertical-tabs{{ id }}" role="tablist" aria-orientation="vertical">
{% for key, item in entity.field_expandable_content_copy %}{% set itemExpanded = loop.first %}
<a id = "{{ item.entity.field_expandable_content_title.value }}" class="nav-link vertical-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" data-bs-toggle="pill" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" type="button" role="tab" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
<a id = "{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="nav-link vertical-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" data-bs-toggle="pill" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" type="button" role="tab" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
{% endfor %}
</div>
<div class="vertical-tab-content ">
Expand Down

0 comments on commit 51faea8

Please sign in to comment.