From a2988c1f106893c0073c87e1076250e1d2436a50 Mon Sep 17 00:00:00 2001 From: Randi Mays Date: Thu, 4 Apr 2024 06:28:50 -0500 Subject: [PATCH 1/5] VACMS-10940 Consolidate reusable and page-specific Q&As on CLPs --- .../campaign_landing_page.drupal.liquid | 2 +- .../q_a.collapsible_panel_clp.drupal.liquid | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid diff --git a/src/site/layouts/campaign_landing_page.drupal.liquid b/src/site/layouts/campaign_landing_page.drupal.liquid index a1410b4386..2bbe4836ff 100644 --- a/src/site/layouts/campaign_landing_page.drupal.liquid +++ b/src/site/layouts/campaign_landing_page.drupal.liquid @@ -486,7 +486,7 @@ {% for reusableQA in fieldClpReusableQA %} {% if reusableQA.entity.entityBundle == "q_a_group" %} {% if reusableQA.entity.fieldAccordionDisplay %} - {% include "src/site/paragraphs/q_a_group_collapsible_content.drupal.liquid" with entity = reusableQA.entity %} + {% include "src/site/paragraphs/q_a_group_collapsible_content_clp.drupal.liquid" with entity = reusableQA.entity %} {% else %} {% include "src/site/paragraphs/q_a_group_content.drupal.liquid" with entity = reusableQA.entity %} {% endif %} diff --git a/src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid b/src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid new file mode 100644 index 0000000000..aacedb4fb0 --- /dev/null +++ b/src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid @@ -0,0 +1,56 @@ +{% comment %} +This is a special implementation for Campaign Landing pages +They can have page-specific Q&As as well as reusable Q&A sections back to back +Because the header of the reusable Q&A section is not required, this can cause +unnecessary separations between different accordion sections at the bottom of the page. + +To remedy this, we have two scenarios: + +1. If a reusable Q&A accordion section is added, but the header is empty, +use the "Frequently Asked Questions" header (that is sent for the page-specific Q&As) +and combine all header-less reusable Q&As with the page-specific Q&As under the FAQ header + +2. If a reusable Q&A accordion section is added and the header is given, +use the header given by the reusable Q&A section and add the page-specific Q&As before the reusable Q&As +in that section + +{% endcomment %} + +
+ + + {% assign questions = entity.fieldQuestions %} + {% assign sectionHeader = entity.fieldSectionHeader %} + + {% for accordionItem in questions %} + {% assign item = accordionItem.entity %} + {% assign id = item.entityId %} + + +
+
+ {% for answer in item.fieldAnswer %} + {% assign bundleComponent = "src/site/paragraphs/" | append: answer.entity.entityBundle | append: ".drupal.liquid" %} + {% include {{ bundleComponent }} with entity = answer.entity %} + {% endfor %} +
+
+
+ {% endfor %} +
+
From fad97c3aa09d4bf88ea0805bf052e8efaedf6e7f Mon Sep 17 00:00:00 2001 From: Randi Mays Date: Mon, 10 Jun 2024 15:13:40 -0500 Subject: [PATCH 2/5] more template changes --- .../campaign_landing_page.drupal.liquid | 74 ++++++++++++++++--- .../q_a.collapsible_panel_clp.drupal.liquid | 56 -------------- 2 files changed, 63 insertions(+), 67 deletions(-) delete mode 100644 src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid diff --git a/src/site/layouts/campaign_landing_page.drupal.liquid b/src/site/layouts/campaign_landing_page.drupal.liquid index 2bbe4836ff..f64ba99e38 100644 --- a/src/site/layouts/campaign_landing_page.drupal.liquid +++ b/src/site/layouts/campaign_landing_page.drupal.liquid @@ -459,7 +459,12 @@

FAQ

-

Frequently asked questions

+ + {% if fieldClpReusableQA and fieldClpReusableQA.entity.fieldSectionHeader %} +

{{ fieldClpReusableQA.entity.fieldSectionHeader }}

+ {% else %} +

Frequently asked questions

+ {% endif %} @@ -480,18 +485,65 @@ {% endif %} {% endfor %} - - - {% for reusableQA in fieldClpReusableQA %} - {% if reusableQA.entity.entityBundle == "q_a_group" %} - {% if reusableQA.entity.fieldAccordionDisplay %} - {% include "src/site/paragraphs/q_a_group_collapsible_content_clp.drupal.liquid" with entity = reusableQA.entity %} - {% else %} - {% include "src/site/paragraphs/q_a_group_content.drupal.liquid" with entity = reusableQA.entity %} - {% endif %} + + {% if fieldClpReusableQA %} + {% assign questions = fieldClpReusableQA.entity.queryFieldQAs %} + + {% if fieldClpReusableQA.entity.entityBundle == "q_a_group" %} + {% if fieldClpReusableQA.entity.fieldAccordionDisplay %} + {% for item in questions %} + {% assign id = item.entityId %} + + +
+
+ {% for answer in item.fieldAnswer %} + {% assign bundleComponent = "src/site/paragraphs/" | append: answer.entity.entityBundle | append: ".drupal.liquid" %} + {% include {{ bundleComponent }} with entity = answer.entity %} + {% endfor %} +
+
+
+ {% endfor %} + {% else %} + {% assign entity = fieldClpReusableQA.entity %} + {% assign fieldQAs = entity.queryFieldQAs.entities %} + + + {% if entity.fieldRichWysiwyg.processed %} + {{ entity.fieldRichWysiwyg.processed }} + {% endif %} + + {% for fieldQA in fieldQAs %} +

{{ fieldQA.entityLabel }}

+ {% if fieldQA.fieldAnswer %} + {% assign fieldAnswer = fieldQA.fieldAnswer %} + {% assign bundleComponent = "src/site/paragraphs/" | append: fieldAnswer.entity.entityBundle %} + {% assign bundleComponentWithExtension = bundleComponent | append: ".drupal.liquid" %} + {% include {{ bundleComponentWithExtension }} with entity = fieldAnswer.entity %} + {% endif %} + + {% endfor %} + {% endif %} + {% endif %} {% endif %} - {% endfor %} +
diff --git a/src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid b/src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid deleted file mode 100644 index aacedb4fb0..0000000000 --- a/src/site/paragraphs/q_a.collapsible_panel_clp.drupal.liquid +++ /dev/null @@ -1,56 +0,0 @@ -{% comment %} -This is a special implementation for Campaign Landing pages -They can have page-specific Q&As as well as reusable Q&A sections back to back -Because the header of the reusable Q&A section is not required, this can cause -unnecessary separations between different accordion sections at the bottom of the page. - -To remedy this, we have two scenarios: - -1. If a reusable Q&A accordion section is added, but the header is empty, -use the "Frequently Asked Questions" header (that is sent for the page-specific Q&As) -and combine all header-less reusable Q&As with the page-specific Q&As under the FAQ header - -2. If a reusable Q&A accordion section is added and the header is given, -use the header given by the reusable Q&A section and add the page-specific Q&As before the reusable Q&As -in that section - -{% endcomment %} - -
- - - {% assign questions = entity.fieldQuestions %} - {% assign sectionHeader = entity.fieldSectionHeader %} - - {% for accordionItem in questions %} - {% assign item = accordionItem.entity %} - {% assign id = item.entityId %} - - -
-
- {% for answer in item.fieldAnswer %} - {% assign bundleComponent = "src/site/paragraphs/" | append: answer.entity.entityBundle | append: ".drupal.liquid" %} - {% include {{ bundleComponent }} with entity = answer.entity %} - {% endfor %} -
-
-
- {% endfor %} -
-
From 18e36f0fa62decfb52f7fda2bc9890b4cb2ada82 Mon Sep 17 00:00:00 2001 From: Randi Mays Date: Tue, 11 Jun 2024 07:40:35 -0500 Subject: [PATCH 3/5] Finishing templates --- src/site/layouts/campaign_landing_page.drupal.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/layouts/campaign_landing_page.drupal.liquid b/src/site/layouts/campaign_landing_page.drupal.liquid index f64ba99e38..90e858e572 100644 --- a/src/site/layouts/campaign_landing_page.drupal.liquid +++ b/src/site/layouts/campaign_landing_page.drupal.liquid @@ -488,7 +488,7 @@ {% if fieldClpReusableQA %} - {% assign questions = fieldClpReusableQA.entity.queryFieldQAs %} + {% assign questions = fieldClpReusableQA.entity.queryFieldQAs.entities %} {% if fieldClpReusableQA.entity.entityBundle == "q_a_group" %} {% if fieldClpReusableQA.entity.fieldAccordionDisplay %} From 6634c30aa69e0148c1d05918218194b0328f3ad2 Mon Sep 17 00:00:00 2001 From: Randi Mays Date: Tue, 11 Jun 2024 08:30:19 -0500 Subject: [PATCH 4/5] Fixing accordion content --- .../campaign_landing_page.drupal.liquid | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/site/layouts/campaign_landing_page.drupal.liquid b/src/site/layouts/campaign_landing_page.drupal.liquid index 90e858e572..d9661cc167 100644 --- a/src/site/layouts/campaign_landing_page.drupal.liquid +++ b/src/site/layouts/campaign_landing_page.drupal.liquid @@ -461,11 +461,13 @@

FAQ

{% if fieldClpReusableQA and fieldClpReusableQA.entity.fieldSectionHeader %} -

{{ fieldClpReusableQA.entity.fieldSectionHeader }}

+ {% assign sectionHeader = fieldClpReusableQA.entity.fieldSectionHeader %} {% else %} -

Frequently asked questions

+ {% assign sectionHeader = "Frequently asked questions" %} {% endif %} +

{{ sectionHeader }}

+ {% for faqParagraph in fieldClpFaqParagraphs %} @@ -496,27 +498,21 @@ {% assign id = item.entityId %}
- {% for answer in item.fieldAnswer %} - {% assign bundleComponent = "src/site/paragraphs/" | append: answer.entity.entityBundle | append: ".drupal.liquid" %} - {% include {{ bundleComponent }} with entity = answer.entity %} - {% endfor %} + {% assign bundleComponent = "src/site/paragraphs/" | append: item.fieldAnswer.entity.entityBundle | append: ".drupal.liquid" %} + {% include {{ bundleComponent }} with entity = item.fieldAnswer.entity %}
From dc440f858a6e65053f4257f19c0a86d694d7d698 Mon Sep 17 00:00:00 2001 From: Randi Mays Date: Fri, 14 Jun 2024 10:09:22 -0500 Subject: [PATCH 5/5] Move intro paragraph --- src/site/layouts/campaign_landing_page.drupal.liquid | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/site/layouts/campaign_landing_page.drupal.liquid b/src/site/layouts/campaign_landing_page.drupal.liquid index d9661cc167..4559f32ac1 100644 --- a/src/site/layouts/campaign_landing_page.drupal.liquid +++ b/src/site/layouts/campaign_landing_page.drupal.liquid @@ -468,6 +468,11 @@

{{ sectionHeader }}

+ + {% if fieldClpReusableQA and fieldClpReusableQA.entity.fieldRichWysiwyg.processed %} + {{ fieldClpReusableQA.entity.fieldRichWysiwyg.processed }} + {% endif %} + {% for faqParagraph in fieldClpFaqParagraphs %} @@ -520,11 +525,6 @@ {% else %} {% assign entity = fieldClpReusableQA.entity %} {% assign fieldQAs = entity.queryFieldQAs.entities %} - - - {% if entity.fieldRichWysiwyg.processed %} - {{ entity.fieldRichWysiwyg.processed }} - {% endif %} {% for fieldQA in fieldQAs %}

{{ fieldQA.entityLabel }}