Skip to content

Commit

Permalink
VACMS-15717: Change reusable Q&As header structure (#1845)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Chris Kim <[email protected]>
  • Loading branch information
chriskim2311 and Chris Kim authored Jan 10, 2024
1 parent 019d4ce commit 31943d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/site/layouts/faq_multiple_q_a.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,22 @@
{% if fieldQAGroup.entity.fieldSectionHeader %}
<h2>{{ fieldQAGroup.entity.fieldSectionHeader }}</h2>
{% endif %}
{% if fieldQAGroup.entity.fieldAccordionDisplay %}
<va-accordion>
{% if fieldQAGroup.entity.fieldAccordionDisplay %}
{% assign headerLevel = '2' %}
{% if fieldQAGroup.entity.fieldSectionHeader %}
{% assign headerLevel = '3' %}
{% endif %}
<va-accordion>
{% assign groupId = fieldQAGroup.entity.entityId %}
{% for fieldQA in fieldQAGroup.entity.fieldQAs %}
{% if fieldQA.entity %}
<va-accordion-item
class="va-accordion-item"
level="{{ headerLevel }}"
header="{{fieldQA.entity.title}}"
data-faq-entity-id="{{ fieldQA.entity.entityId }}"
id="{{ fieldQA.entity.title | hashReference: 60 }}"
>
<h3 slot="headline">
{{ fieldQA.entity.title }}
</h3>
<div id="{{ fieldQA.entity.entityBundle }}-{{ fieldQA.entity.entityId }}-{{ groupId }}">
{% assign fieldAnswer = fieldQA.entity.fieldAnswer %}
{% assign bundleComponent = "src/site/paragraphs/" | append: fieldAnswer.entity.entityBundle %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% assign fieldQAs = entity.queryFieldQAs.entities %}

<!-- Optional section header -->
{% assign headerLevel = "2" %}
{% if entity.fieldSectionHeader %}
<h2>{{ entity.fieldSectionHeader }}</h2>
{% assign headerLevel = "3" %}
{% endif %}

<!-- Optional QA Group Introduction -->
Expand All @@ -13,7 +15,7 @@
<va-accordion>
{% for item in fieldQAs %}
{% assign id = item.entityId %}
<va-accordion-item header="{{ item.entityLabel }}" id="{{ item.entityLabel | hashReference: 60 }}">
<va-accordion-item header="{{ item.entityLabel }}" level="{{ headerLevel }}" id="{{ item.entityLabel | hashReference: 60 }}">
<div id={{ id }} data-entity-id="{{ id }}">
<div id="{{ item.fieldAnswer.entity.entityBundle }}-{{ item.fieldAnswer.entity.entityId }}">
{% if item.fieldAnswer %}
Expand Down

0 comments on commit 31943d8

Please sign in to comment.