Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-15717: Change reusable Q&As header structure #1845

Merged
merged 8 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -69,20 +69,22 @@
<button type="button" class="vads-u-visibility--screen-reader">Back to top</button>
<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
Loading