From 4a96c35c1de11a6f94716550c705cdd7d5f204c4 Mon Sep 17 00:00:00 2001 From: cathybaptista <161740096+cathybaptista@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:27:13 -0500 Subject: [PATCH] DIGITAL-60: Change glossary link to entity reference, should not trigger any js for now. --- ...ntity_form_display.node.guides.default.yml | 7 ++++++ ...ntity_view_display.node.guides.default.yml | 8 +++++++ ...entity_view_display.node.guides.teaser.yml | 2 ++ ...d.field.node.guides.field_hcd_glossary.yml | 23 +++++++++++++++++++ .../field.storage.node.field_hcd_glossary.yml | 20 ++++++++++++++++ .../templates/node/node--guides.html.twig | 4 ++++ 6 files changed, 64 insertions(+) create mode 100644 config/sync/field.field.node.guides.field_hcd_glossary.yml create mode 100644 config/sync/field.storage.node.field_hcd_glossary.yml diff --git a/config/sync/core.entity_form_display.node.guides.default.yml b/config/sync/core.entity_form_display.node.guides.default.yml index 9fff09ea..bc50c75b 100644 --- a/config/sync/core.entity_form_display.node.guides.default.yml +++ b/config/sync/core.entity_form_display.node.guides.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.guides.field_deck - field.field.node.guides.field_featured_image - field.field.node.guides.field_guide_weight + - field.field.node.guides.field_hcd_glossary - field.field.node.guides.field_kicker - field.field.node.guides.field_page_weight - field.field.node.guides.field_primary_image @@ -69,6 +70,12 @@ content: settings: placeholder: '' third_party_settings: { } + field_hcd_glossary: + type: options_select + weight: 51 + region: content + settings: { } + third_party_settings: { } field_kicker: type: string_textfield weight: 1 diff --git a/config/sync/core.entity_view_display.node.guides.default.yml b/config/sync/core.entity_view_display.node.guides.default.yml index 073c2e67..21aaaed8 100644 --- a/config/sync/core.entity_view_display.node.guides.default.yml +++ b/config/sync/core.entity_view_display.node.guides.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.guides.field_deck - field.field.node.guides.field_featured_image - field.field.node.guides.field_guide_weight + - field.field.node.guides.field_hcd_glossary - field.field.node.guides.field_kicker - field.field.node.guides.field_page_weight - field.field.node.guides.field_primary_image @@ -59,6 +60,13 @@ content: third_party_settings: { } weight: 127 region: content + field_hcd_glossary: + type: entity_reference_entity_id + label: hidden + settings: { } + third_party_settings: { } + weight: 128 + region: content field_kicker: type: string label: above diff --git a/config/sync/core.entity_view_display.node.guides.teaser.yml b/config/sync/core.entity_view_display.node.guides.teaser.yml index c8354e34..9c3fad1e 100644 --- a/config/sync/core.entity_view_display.node.guides.teaser.yml +++ b/config/sync/core.entity_view_display.node.guides.teaser.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.guides.field_deck - field.field.node.guides.field_featured_image - field.field.node.guides.field_guide_weight + - field.field.node.guides.field_hcd_glossary - field.field.node.guides.field_kicker - field.field.node.guides.field_page_weight - field.field.node.guides.field_primary_image @@ -45,6 +46,7 @@ hidden: field_deck: true field_featured_image: true field_guide_weight: true + field_hcd_glossary: true field_kicker: true field_page_weight: true field_primary_image: true diff --git a/config/sync/field.field.node.guides.field_hcd_glossary.yml b/config/sync/field.field.node.guides.field_hcd_glossary.yml new file mode 100644 index 00000000..420afd7a --- /dev/null +++ b/config/sync/field.field.node.guides.field_hcd_glossary.yml @@ -0,0 +1,23 @@ +uuid: 051af63b-df7a-49f4-8609-9600eb7ec67f +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_hcd_glossary + - node.type.guides +id: node.guides.field_hcd_glossary +field_name: field_hcd_glossary +entity_type: node +bundle: guides +label: 'HCD Glossary' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_vocabulary' + handler_settings: + target_bundles: null + auto_create: false +field_type: entity_reference diff --git a/config/sync/field.storage.node.field_hcd_glossary.yml b/config/sync/field.storage.node.field_hcd_glossary.yml new file mode 100644 index 00000000..4cc9a8f2 --- /dev/null +++ b/config/sync/field.storage.node.field_hcd_glossary.yml @@ -0,0 +1,20 @@ +uuid: 582cdc00-7855-441f-b6f4-6b0efe4f403d +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_hcd_glossary +field_name: field_hcd_glossary +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_vocabulary +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/web/themes/custom/digital_gov/templates/node/node--guides.html.twig b/web/themes/custom/digital_gov/templates/node/node--guides.html.twig index 0ab44277..033a8e8a 100644 --- a/web/themes/custom/digital_gov/templates/node/node--guides.html.twig +++ b/web/themes/custom/digital_gov/templates/node/node--guides.html.twig @@ -75,6 +75,10 @@ {{ $guideData = index $.Site.Data.guidenav (.Params.guide) }} {% endif %} #} + {# this sets up the button to call the JS to show the glossary #} + {% if content.field_hcd_glossary['#title'] is not null %} + + {% endif %} {% if guideData.showInPageNav %}