diff --git a/composer.lock b/composer.lock index 640186749..587562fcd 100644 --- a/composer.lock +++ b/composer.lock @@ -876,12 +876,12 @@ "source": { "type": "git", "url": "https://github.com/ilrWebServices/union.git", - "reference": "eb5d3487f124c23f5d0784a476d596885660a6c7" + "reference": "ad619181fd86bb29a94ff418e0b4c27507a365b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ilrWebServices/union/zipball/eb5d3487f124c23f5d0784a476d596885660a6c7", - "reference": "eb5d3487f124c23f5d0784a476d596885660a6c7", + "url": "https://api.github.com/repos/ilrWebServices/union/zipball/ad619181fd86bb29a94ff418e0b4c27507a365b8", + "reference": "ad619181fd86bb29a94ff418e0b4c27507a365b8", "shasum": "" }, "require": { @@ -915,7 +915,7 @@ "source": "https://github.com/ilrWebServices/union/tree/master", "issues": "https://github.com/ilrWebServices/union/issues" }, - "time": "2026-01-07T15:08:11+00:00" + "time": "2026-01-12T23:35:34+00:00" }, { "name": "cweagans/composer-patches", diff --git a/config/sync/collection.collection_item_type.default.yml b/config/sync/collection.collection_item_type.default.yml index 1c86e1d7f..2f7e526a7 100644 --- a/config/sync/collection.collection_item_type.default.yml +++ b/config/sync/collection.collection_item_type.default.yml @@ -15,5 +15,6 @@ allowed_bundles: - node.event_landing_page - node.media_mention - node.page + - node.report_summary - node.story attributes_access: administrators diff --git a/config/sync/core.entity_form_display.node.report_summary.default.yml b/config/sync/core.entity_form_display.node.report_summary.default.yml new file mode 100644 index 000000000..125f31f73 --- /dev/null +++ b/config/sync/core.entity_form_display.node.report_summary.default.yml @@ -0,0 +1,174 @@ +uuid: 00000000-0000-0000-0000-000000000020 +langcode: en +status: true +dependencies: + config: + - field.field.node.report_summary.field_address + - field.field.node.report_summary.field_authors + - field.field.node.report_summary.field_emphasized_title_text + - field.field.node.report_summary.field_published_date + - field.field.node.report_summary.field_report_pdf + - field.field.node.report_summary.field_report_topics + - field.field.node.report_summary.field_representative_image + - field.field.node.report_summary.field_sections + - field.field.node.report_summary.layout_builder__layout + - node.type.report_summary + module: + - address + - datetime + - media_library + - media_library_edit + - paragraphs_previewer + - path +id: node.report_summary.default +targetEntityType: node +bundle: report_summary +mode: default +content: + created: + type: datetime_timestamp + weight: 2 + region: content + settings: { } + third_party_settings: { } + field_address: + type: address_default + weight: 12 + region: content + settings: { } + third_party_settings: { } + field_authors: + type: entity_reference_autocomplete + weight: 15 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_emphasized_title_text: + type: string_textfield + weight: 10 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_published_date: + type: datetime_default + weight: 16 + region: content + settings: { } + third_party_settings: { } + field_report_pdf: + type: media_library_widget + weight: 14 + region: content + settings: + media_types: { } + third_party_settings: + media_library_edit: + show_edit: '1' + field_report_topics: + type: entity_reference_autocomplete + weight: 13 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_representative_image: + type: media_library_widget + weight: 11 + region: content + settings: + media_types: { } + third_party_settings: + media_library_edit: + show_edit: '1' + field_sections: + type: paragraphs_previewer + weight: 17 + region: content + settings: + title: section + title_plural: sections + edit_mode: closed + closed_mode: summary + autocollapse: all + closed_mode_threshold: 2 + add_mode: button + form_display_mode: default + default_paragraph_type: section + features: + add_above: '0' + collapse_edit_all: collapse_edit_all + duplicate: duplicate + third_party_settings: { } + langcode: + type: language_select + weight: 1 + region: content + settings: + include_locked: true + third_party_settings: { } + layout_builder__layout: + type: null + weight: 51 + region: content + settings: { } + third_party_settings: { } + path: + type: path + weight: 5 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + weight: 3 + region: content + settings: + display_label: true + third_party_settings: { } + status: + type: boolean_checkbox + weight: 6 + region: content + settings: + display_label: true + third_party_settings: { } + sticky: + type: boolean_checkbox + weight: 4 + region: content + settings: + display_label: true + third_party_settings: { } + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 1 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + url_redirects: + weight: 50 + region: content + settings: { } + third_party_settings: { } +hidden: { } diff --git a/config/sync/core.entity_view_display.node.report_summary.default.yml b/config/sync/core.entity_view_display.node.report_summary.default.yml new file mode 100644 index 000000000..a0365cd08 --- /dev/null +++ b/config/sync/core.entity_view_display.node.report_summary.default.yml @@ -0,0 +1,291 @@ +uuid: 00000000-0000-0000-0000-000000000021 +langcode: en +status: true +dependencies: + config: + - field.field.node.report_summary.field_address + - field.field.node.report_summary.field_authors + - field.field.node.report_summary.field_emphasized_title_text + - field.field.node.report_summary.field_published_date + - field.field.node.report_summary.field_report_pdf + - field.field.node.report_summary.field_report_topics + - field.field.node.report_summary.field_representative_image + - field.field.node.report_summary.field_sections + - field.field.node.report_summary.layout_builder__layout + - node.type.report_summary + module: + - address + - datetime + - entity_reference_revisions + - ilr + - layout_builder + - layout_discovery + - system + - user +third_party_settings: + layout_builder: + enabled: true + allow_custom: true + sections: + - + layout_id: banner + layout_settings: + label: '' + context_mapping: { } + color_scheme: dark + hide_frame: true + text_align: left + full_bleed: true + components: + 26c5ec80-4c2a-486d-9206-45f4caf49eac: + uuid: 26c5ec80-4c2a-486d-9206-45f4caf49eac + region: banner + configuration: + id: system_breadcrumb_block + label: Breadcrumbs + label_display: '0' + provider: system + context_mapping: { } + weight: 0 + additional: { } + cba962d8-8d80-46a0-8bd2-f24d8bfd5536: + uuid: cba962d8-8d80-46a0-8bd2-f24d8bfd5536 + region: banner + configuration: + id: 'field_block:node:report_summary:title' + label: Title + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 1 + additional: { } + report-topics-field: + uuid: report-topics-field + region: banner + configuration: + id: 'field_block:node:report_summary:field_report_topics' + label: Topics + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 2 + additional: { } + ee3862f3-e8f9-4a3f-8610-f0a33055873f: + uuid: ee3862f3-e8f9-4a3f-8610-f0a33055873f + region: media + configuration: + id: 'field_block:node:report_summary:field_representative_image' + label: 'Representative Image' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + type: entity_reference_entity_view + label: hidden + settings: + view_mode: default + third_party_settings: { } + weight: 1 + additional: { } + sidebar-published-date: + uuid: sidebar-published-date + region: sidebar + configuration: + id: 'field_block:node:report_summary:field_published_date' + label: 'Published Date' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: datetime_custom + label: above + settings: + timezone_override: '' + date_format: 'D, m/d/Y' + third_party_settings: { } + weight: 1 + additional: { } + sidebar-authors: + uuid: sidebar-authors + region: sidebar + configuration: + id: 'field_block:node:report_summary:field_authors' + label: Author(s) + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 2 + additional: { } + sidebar-pdf: + uuid: sidebar-pdf + region: sidebar + configuration: + id: 'field_block:node:report_summary:field_report_pdf' + label: 'Download Report' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 3 + additional: { } + third_party_settings: { } + - + layout_id: layout_onecol + layout_settings: + label: 'In-page nav' + context_mapping: { } + components: + 0395edef-fdc2-4166-ba11-d770ba19aa3b: + uuid: 0395edef-fdc2-4166-ba11-d770ba19aa3b + region: content + configuration: + id: 'extra_field_block:node:report_summary:extra_field_ilr_section_navigation' + label_display: '0' + context_mapping: + entity: layout_builder.entity + weight: 3 + additional: { } + third_party_settings: { } + - + layout_id: layout_onecol + layout_settings: + label: 'Report sections' + context_mapping: { } + components: + 7ab5d735-5fc6-4a5c-b4a3-a52e775d5f16: + uuid: 7ab5d735-5fc6-4a5c-b4a3-a52e775d5f16 + region: content + configuration: + id: 'field_block:node:report_summary:field_sections' + label: Sections + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + third_party_settings: { } + weight: 0 + additional: { } + third_party_settings: { } +id: node.report_summary.default +targetEntityType: node +bundle: report_summary +mode: default +content: + extra_field_ilr_section_navigation: + settings: { } + third_party_settings: { } + weight: 0 + region: banner + field_address: + type: address_default + label: above + settings: { } + third_party_settings: { } + weight: 104 + region: content + field_authors: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 105 + region: content + field_emphasized_title_text: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 101 + region: content + field_published_date: + type: datetime_default + label: above + settings: + timezone_override: '' + format_type: medium + third_party_settings: { } + weight: 106 + region: content + field_report_pdf: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 103 + region: content + field_report_topics: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 102 + region: content + field_representative_image: + type: entity_reference_label + label: hidden + settings: + link: true + third_party_settings: { } + weight: 100 + region: content + field_sections: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 107 + region: content + links: + settings: { } + third_party_settings: { } + weight: 99 + region: content +hidden: + langcode: true + layout_builder__layout: true + search_api_excerpt: true diff --git a/config/sync/field.field.node.report_summary.field_address.yml b/config/sync/field.field.node.report_summary.field_address.yml new file mode 100644 index 000000000..68f235a13 --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_address.yml @@ -0,0 +1,60 @@ +uuid: 00000000-0000-0000-0000-000000000011 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_address + - node.type.report_summary + module: + - address +id: node.report_summary.field_address +field_name: field_address +entity_type: node +bundle: report_summary +label: State +description: '' +required: false +translatable: false +default_value: + - + langcode: '' + country_code: US + administrative_area: '' + locality: '' + dependent_locality: null + postal_code: '' + sorting_code: null + address_line1: '' + address_line2: '' + organization: '' + given_name: '' + additional_name: null + family_name: '' +default_value_callback: '' +settings: + available_countries: + US: US + langcode_override: '' + field_overrides: + givenName: + override: hidden + additionalName: + override: hidden + familyName: + override: hidden + organization: + override: hidden + addressLine1: + override: hidden + addressLine2: + override: hidden + locality: + override: hidden + postalCode: + override: hidden + sortingCode: + override: hidden + dependentLocality: + override: hidden + fields: { } +field_type: address diff --git a/config/sync/field.field.node.report_summary.field_authors.yml b/config/sync/field.field.node.report_summary.field_authors.yml new file mode 100644 index 000000000..26568297a --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_authors.yml @@ -0,0 +1,28 @@ +uuid: 00000000-0000-0000-0000-000000000016 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_authors + - node.type.report_summary + - person.persona_type.author +id: node.report_summary.field_authors +field_name: field_authors +entity_type: node +bundle: report_summary +label: Author(s) +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:persona' + handler_settings: + target_bundles: + author: author + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/sync/field.field.node.report_summary.field_emphasized_title_text.yml b/config/sync/field.field.node.report_summary.field_emphasized_title_text.yml new file mode 100644 index 000000000..82ce7c979 --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_emphasized_title_text.yml @@ -0,0 +1,19 @@ +uuid: 00000000-0000-0000-0000-000000000010 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_emphasized_title_text + - node.type.report_summary +id: node.report_summary.field_emphasized_title_text +field_name: field_emphasized_title_text +entity_type: node +bundle: report_summary +label: 'Emphasized title text' +description: 'A string that, if it matches a portion of the title, will be wrapped with when rendered in cards.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/field.field.node.report_summary.field_published_date.yml b/config/sync/field.field.node.report_summary.field_published_date.yml new file mode 100644 index 000000000..757a5b2fa --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_published_date.yml @@ -0,0 +1,24 @@ +uuid: 00000000-0000-0000-0000-000000000017 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_published_date + - node.type.report_summary + module: + - datetime +id: node.report_summary.field_published_date +field_name: field_published_date +entity_type: node +bundle: report_summary +label: 'Published Date' +description: 'The published date for this report.' +required: true +translatable: false +default_value: + - + default_date_type: now + default_date: now +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/config/sync/field.field.node.report_summary.field_report_pdf.yml b/config/sync/field.field.node.report_summary.field_report_pdf.yml new file mode 100644 index 000000000..a142f9219 --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_report_pdf.yml @@ -0,0 +1,29 @@ +uuid: 00000000-0000-0000-0000-000000000015 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_report_pdf + - media.type.file + - node.type.report_summary +id: node.report_summary.field_report_pdf +field_name: field_report_pdf +entity_type: node +bundle: report_summary +label: 'Report PDF' +description: 'Upload the PDF file for this report.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + file: file + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: file +field_type: entity_reference diff --git a/config/sync/field.field.node.report_summary.field_report_topics.yml b/config/sync/field.field.node.report_summary.field_report_topics.yml new file mode 100644 index 000000000..7f933c11f --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_report_topics.yml @@ -0,0 +1,29 @@ +uuid: 00000000-0000-0000-0000-000000000012 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_report_topics + - node.type.report_summary + - taxonomy.vocabulary.report_topics +id: node.report_summary.field_report_topics +field_name: field_report_topics +entity_type: node +bundle: report_summary +label: 'Report topics' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + report_topics: report_topics + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/sync/field.field.node.report_summary.field_representative_image.yml b/config/sync/field.field.node.report_summary.field_representative_image.yml new file mode 100644 index 000000000..cc4672702 --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_representative_image.yml @@ -0,0 +1,29 @@ +uuid: 00000000-0000-0000-0000-000000000013 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_representative_image + - media.type.image + - node.type.report_summary +id: node.report_summary.field_representative_image +field_name: field_representative_image +entity_type: node +bundle: report_summary +label: 'Representative image' +description: 'This image is used when sharing this content, either on social media or in report listings.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + image: image + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: image +field_type: entity_reference diff --git a/config/sync/field.field.node.report_summary.field_sections.yml b/config/sync/field.field.node.report_summary.field_sections.yml new file mode 100644 index 000000000..25ad4421b --- /dev/null +++ b/config/sync/field.field.node.report_summary.field_sections.yml @@ -0,0 +1,64 @@ +uuid: 00000000-0000-0000-0000-000000000014 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_sections + - node.type.report_summary + - paragraphs.paragraphs_type.section + module: + - entity_reference_revisions +id: node.report_summary.field_sections +field_name: field_sections +entity_type: node +bundle: report_summary +label: Sections +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + section: section + negate: 0 + target_bundles_drag_drop: + collection_listing: + weight: 13 + enabled: false + deck: + weight: 14 + enabled: false + form: + weight: 15 + enabled: false + image: + weight: 16 + enabled: false + person: + weight: 17 + enabled: false + promo: + weight: 18 + enabled: false + referenced_entity: + weight: 19 + enabled: false + rich_text: + weight: 20 + enabled: false + section: + weight: 21 + enabled: true + simple_collection_listing: + weight: 22 + enabled: false + testimonial: + weight: 23 + enabled: false + video: + weight: 24 + enabled: false +field_type: entity_reference_revisions diff --git a/config/sync/field.field.node.report_summary.layout_builder__layout.yml b/config/sync/field.field.node.report_summary.layout_builder__layout.yml new file mode 100644 index 000000000..775013bf2 --- /dev/null +++ b/config/sync/field.field.node.report_summary.layout_builder__layout.yml @@ -0,0 +1,21 @@ +uuid: 00000000-0000-0000-0000-000000000030 +langcode: en +status: true +dependencies: + config: + - field.storage.node.layout_builder__layout + - node.type.report_summary + module: + - layout_builder +id: node.report_summary.layout_builder__layout +field_name: layout_builder__layout +entity_type: node +bundle: report_summary +label: Layout +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: layout_section diff --git a/config/sync/field.storage.node.field_emphasized_title_text.yml b/config/sync/field.storage.node.field_emphasized_title_text.yml new file mode 100644 index 000000000..e6e802b11 --- /dev/null +++ b/config/sync/field.storage.node.field_emphasized_title_text.yml @@ -0,0 +1,21 @@ +uuid: 00000000-0000-0000-0000-000000000003 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_emphasized_title_text +field_name: field_emphasized_title_text +entity_type: node +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_report_pdf.yml b/config/sync/field.storage.node.field_report_pdf.yml new file mode 100644 index 000000000..891ae6d9a --- /dev/null +++ b/config/sync/field.storage.node.field_report_pdf.yml @@ -0,0 +1,20 @@ +uuid: 00000000-0000-0000-0000-000000000004 +langcode: en +status: true +dependencies: + module: + - media + - node +id: node.field_report_pdf +field_name: field_report_pdf +entity_type: node +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_report_topics.yml b/config/sync/field.storage.node.field_report_topics.yml new file mode 100644 index 000000000..c7bdb1cab --- /dev/null +++ b/config/sync/field.storage.node.field_report_topics.yml @@ -0,0 +1,20 @@ +uuid: 00000000-0000-0000-0000-000000000005 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_report_topics +field_name: field_report_topics +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/node.type.report_summary.yml b/config/sync/node.type.report_summary.yml new file mode 100644 index 000000000..5b5184d7a --- /dev/null +++ b/config/sync/node.type.report_summary.yml @@ -0,0 +1,17 @@ +uuid: 00000000-0000-0000-0000-000000000002 +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: { } + parent: '' +name: 'Report summary' +type: report_summary +description: 'Use Report summary to create report detail pages with sections, topics, and downloadable PDFs' +help: null +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/config/sync/taxonomy.vocabulary.report_topics.yml b/config/sync/taxonomy.vocabulary.report_topics.yml new file mode 100644 index 000000000..66eca6c00 --- /dev/null +++ b/config/sync/taxonomy.vocabulary.report_topics.yml @@ -0,0 +1,9 @@ +uuid: 00000000-0000-0000-0000-000000000001 +langcode: en +status: true +dependencies: { } +name: 'Report topics' +vid: report_topics +description: 'Topics for report summaries' +weight: 0 +new_revision: false diff --git a/web/modules/custom/ilr/ilr.layouts.yml b/web/modules/custom/ilr/ilr.layouts.yml index ac4c19915..e0bd9cd78 100644 --- a/web/modules/custom/ilr/ilr.layouts.yml +++ b/web/modules/custom/ilr/ilr.layouts.yml @@ -13,3 +13,5 @@ banner: label: Banner media: label: Media + sidebar: + label: Sidebar diff --git a/web/modules/custom/ilr/ilr.module b/web/modules/custom/ilr/ilr.module index 5f9574ba1..6fb1f771c 100644 --- a/web/modules/custom/ilr/ilr.module +++ b/web/modules/custom/ilr/ilr.module @@ -758,6 +758,53 @@ function ilr_preprocess_node__page__alt(&$variables) { $variables['page'] = TRUE; } +/** + * Implements hook_preprocess_HOOK() for field templates. + */ +function ilr_preprocess_field(&$variables) { + // Override PDF link text for Report Summary. + if ($variables['field_name'] === 'field_report_pdf' && + $variables['element']['#bundle'] === 'report_summary') { + foreach ($variables['items'] as &$item) { + if (isset($item['content']['#title'])) { + $item['content']['#title'] = 'Read the Report'; + } + } + } +} + +/** + * Implements hook_preprocess_HOOK() for layout templates. + */ +function ilr_preprocess_layout(&$variables) { + // Add content type specific class to banner layout for report_summary. + if (isset($variables['content']['#entity']) && $variables['content']['#entity'] instanceof NodeInterface) { + $node = $variables['content']['#entity']; + if ($node->bundle() === 'report_summary' && isset($variables['attributes']['class'])) { + $variables['attributes']['class'][] = 'cu-banner--report_summary'; + } + } +} + +/** + * Implements hook_preprocess_HOOK() for item list templates. + */ +function ilr_preprocess_item_list(&$variables) { + // Pass the current node to section navigation item lists. + if (isset($variables['context']['collection']) || + (isset($variables['theme_hook_original']) && $variables['theme_hook_original'] === 'item_list__section_navigation')) { + $node = \Drupal::routeMatch()->getParameter('node'); + + if (is_numeric($node)) { + $node = \Drupal::entityTypeManager()->getStorage('node')->load($node); + } + + if ($node instanceof NodeInterface) { + $variables['node'] = $node; + } + } +} + /** * Implements template_preprocess_collection(). */ diff --git a/web/modules/custom/ilr/templates/banner--node--report-summary.html.twig b/web/modules/custom/ilr/templates/banner--node--report-summary.html.twig new file mode 100644 index 000000000..340ab1449 --- /dev/null +++ b/web/modules/custom/ilr/templates/banner--node--report-summary.html.twig @@ -0,0 +1,50 @@ +{# +/** + * @file + * Banner layout template for Report Summary content type. + * + * This is a custom template specifically for report_summary nodes + * to implement the Figma design with sidebar positioned on the right. + */ +#} + + +{% set rendered_content %} +{% if content.top %} +{{ content.top }} +{% endif %} + +{% if content.sidebar %} + +{% endif %} +{% endset %} + +{% set attributes = attributes.addClass('cu-colorscheme--' ~ settings.color_scheme) %} +{% set attributes = attributes.addClass('cu-banner--page') %} +{% if settings.hide_frame %} +{% set attributes = attributes.addClass('cu-banner--hide-frame') %} +{% endif %} +{% if settings.text_align == 'center' %} +{% set attributes = attributes.addClass('cu-banner--text-center') %} +{% endif %} +{% if settings.full_bleed %} +{% set attributes = attributes.addClass('cu-banner--full-bleed') %} +{% endif %} + +{% if content['#entity'] and content['#entity'].bundle() %} +{% set type = content['#entity'].getEntityTypeId() %} +{% set bundle = content['#entity'].bundle() %} +{% set attributes = attributes.addClass('cu-banner--' ~ type) %} +{% set attributes = attributes.addClass('cu-banner--' ~ bundle) %} +{% endif %} + +{% include '@union/_banner.twig' with { + attributes: attributes, + content: rendered_content, + media: content.media|render +} only %} + diff --git a/web/modules/custom/ilr/templates/banner.html.twig b/web/modules/custom/ilr/templates/banner.html.twig index 58306f372..2a742fd78 100644 --- a/web/modules/custom/ilr/templates/banner.html.twig +++ b/web/modules/custom/ilr/templates/banner.html.twig @@ -33,6 +33,7 @@ {% include '@union/_banner.twig' with { attributes: attributes, content: rendered_content, - media: content.media|render + media: content.media|render, + content_side: content.sidebar ?? content.sidebar } only %} diff --git a/web/modules/custom/ilr/templates/field--field-report-topics.html.twig b/web/modules/custom/ilr/templates/field--field-report-topics.html.twig new file mode 100644 index 000000000..bc5630c4a --- /dev/null +++ b/web/modules/custom/ilr/templates/field--field-report-topics.html.twig @@ -0,0 +1,13 @@ +{# +/** + * @file + * Theme override for the report topics field. + */ +#} + + {% for item in items %} + + {{ item.content }} + + {% endfor %} + diff --git a/web/modules/custom/ilr/templates/field--node--field-report-topics--report-summary.html.twig b/web/modules/custom/ilr/templates/field--node--field-report-topics--report-summary.html.twig new file mode 100644 index 000000000..750768788 --- /dev/null +++ b/web/modules/custom/ilr/templates/field--node--field-report-topics--report-summary.html.twig @@ -0,0 +1,27 @@ +{# +/** + * @file + * Theme override for the report topics field on report summary nodes. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + */ +#} + + {% for item in items %} + + {{ item.content }} + + {% endfor %} + diff --git a/web/modules/custom/ilr_section_navigation/src/Plugin/ExtraField/Display/SectionNavigation.php b/web/modules/custom/ilr_section_navigation/src/Plugin/ExtraField/Display/SectionNavigation.php index 06f6a8d8d..786812243 100644 --- a/web/modules/custom/ilr_section_navigation/src/Plugin/ExtraField/Display/SectionNavigation.php +++ b/web/modules/custom/ilr_section_navigation/src/Plugin/ExtraField/Display/SectionNavigation.php @@ -6,6 +6,7 @@ use Drupal\extra_field\Plugin\ExtraFieldDisplayBase; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -20,6 +21,7 @@ * "collection.subsite_blog", * "collection.content_section", * "node.page", + * "node.report_summary", * "taxonomy_term.*", * }, * visible = true @@ -73,12 +75,18 @@ public function view(ContentEntityInterface $entity) { $elements['ilr_section_navigation'] = [ '#theme' => 'item_list__section_navigation', '#items' => $links, - '#attributes' => ['class' => 'section-navigation'], + '#attributes' => ['class' => ['section-navigation']], '#context' => ['collection' => $entity], '#cache' => [ 'tags' => $entity->getCacheTags(), ], ]; + + if ($entity instanceof NodeInterface && $entity->bundle() === 'report_summary') { + $elements['ilr_section_navigation']['#attributes']['class'][] = 'cu-page-nav--select'; + $elements['ilr_section_navigation']['#attributes']['class'][] = 'cu-colorscheme--light'; + $elements['ilr_section_navigation']['#title'] = $this->t('Jump to:'); + } } return $elements; diff --git a/web/themes/custom/union_marketing/css/report-summary.css b/web/themes/custom/union_marketing/css/report-summary.css new file mode 100644 index 000000000..87fc1fb00 --- /dev/null +++ b/web/themes/custom/union_marketing/css/report-summary.css @@ -0,0 +1,139 @@ +/** + * Report Summary Banner Styling + * Based on Figma designs for Report Summary content type + */ + +.cu-banner--report_summary { + --banner-padding: 0 !important; + background-color: unset; + margin-bottom: var(--cu-vr1) !important; +} + +.cu-banner--report_summary .cu-banner__content { + padding: var(--cu-vr1) var(--cu-ps0); + background-color: var(--cu-colorscheme-background); +} + +.cu-banner--report_summary .banner__content { + padding-right: unset !important; + min-height: unset !important; +} + +.cu-banner--report_summary .cu-banner__media img { + aspect-ratio: 1/1; +} + +.cu-banner--report_summary .cu-banner__content_side { + position: relative; + width: calc(100% - 2 * var(--cu-ps0)); + margin: calc(var(--cu-vr2) * -1) auto 0; + padding: var(--cu-vr1) var(--cu-ps1); + --cu-text-color: var(--cu-color-dark); + background-color: var(--cu-color-white); + z-index: 1; + --cu-font-size: var(--cu-ms-2); + display: flex; + flex-direction: column; + gap: var(--cu-vr-1); +} + +.cu-banner--report_summary .cu-banner__content_side .field__label { + font-weight: bold; +} + +.cu-banner--report_summary .cu-banner__content_side .cu-button--report { + margin-top: var(--cu-vr-2); + text-align: center; + width: 100%; +} + +/* Remove overlay pseudo elements */ +.cu-banner--report_summary::before, +.cu-banner--report_summary .cu-banner__media::before { + all: unset; +} + +/* Hide current page title in breadcrumbs. See _breadcrumbs.scss */ +.cu-banner--report_summary .cu-breadcrumb:not(.breadcrumb-altered) .cu-breadcrumb__item:nth-last-child(2):after, +.cu-banner--report_summary .cu-breadcrumb:not(.breadcrumb-altered) .cu-breadcrumb__item:last-child { + display: none; +} + +.node--view-mode-full .cu-banner--report_summary .cu-heading.field--title { + --cu-font-size: var(--cu-ms4); + line-height: 1.3; +} + +@media (min-width: 37.5rem) { + .cu-banner--report_summary { + display: grid; + grid-template-columns: 1fr 1fr; + } + + .node--view-mode-full .cu-banner--report_summary .cu-heading.field--title { + --cu-font-size: var(--cu-ms8); + line-height: 1.1; + } + + .cu-banner--report_summary .cu-banner__content { + padding-left: var(--cu-ps2); + } + + .cu-banner--report_summary .cu-banner__content_side { + position: absolute; + bottom: var(--cu-vr0); + right: var(--cu-ps0); + width: 250px; + max-width: 50%; + margin-top: unset; + } + + .cu-banner--report_summary .cu-banner__media img { + aspect-ratio: 7/6; + } +} + +/* Topic tags styling - pill style */ +/* TODO: Update the field template to use button component pill variant. */ +.cu-banner--report_summary .field--field-report-topics { + display: flex; + flex-wrap: wrap; + gap: var(--cu-ps-1); +} + +.cu-banner--report_summary .field--field-report-topics .field__item { + padding: 8px var(--cu-ps1); + border-radius: 1.5rem; + font-weight: 700; + font-size: var(--cu-ms-2); + text-decoration: none; + white-space: nowrap; + background: rgba(0, 0, 0, 0.5); + border: 1px solid var(--cu-color-gray); +} + +/* In-page links on report summary nodes */ +.node--report_summary .cu-page-nav { + margin-bottom: var(--cu-vr2); +} + +@media (min-width: 61rem) { + .node--report_summary .cu-page-nav .cu-page-nav__link { + display: flex; + gap: .5rem; + align-items: center; + } + + .node--report_summary .cu-page-nav__link::after { + content: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill:%23000000;stroke:%23000000;stroke-width:1;stroke-linecap:square' d='M 7,1 V 12' /%3E%3Cpath style='fill:none;stroke:%23000000;stroke-width:1;stroke-linejoin:round' d='M 13,7 7,13 1,7' /%3E%3C/svg%3E"); + } + + .node--report_summary .cu-page-nav .cu-page-nav__link .cu-heading { + text-transform: uppercase; + --cu-font-size: var(--cu-ms-4); + } + + .node--report_summary .cu-page-nav__item:has(.cu-page-nav__select-trigger) { + display: none; + } +} diff --git a/web/themes/custom/union_marketing/templates/content/item-list--section-navigation.html.twig b/web/themes/custom/union_marketing/templates/content/item-list--section-navigation.html.twig index c1654a9a2..8ef0ced2e 100644 --- a/web/themes/custom/union_marketing/templates/content/item-list--section-navigation.html.twig +++ b/web/themes/custom/union_marketing/templates/content/item-list--section-navigation.html.twig @@ -1,7 +1,7 @@ {# /** * @file - * Theme override for a collection item list. + * Theme override for section navigation. * * Available variables: * - items: A list of items. Each item contains: @@ -31,6 +31,7 @@ {% include '@union/_page-nav.twig' with { heading: title, - items: links + items: links, + attributes: attributes } only %} diff --git a/web/themes/custom/union_marketing/templates/field/field--node--field-report-pdf--report-summary.html.twig b/web/themes/custom/union_marketing/templates/field/field--node--field-report-pdf--report-summary.html.twig new file mode 100644 index 000000000..5c01f533a --- /dev/null +++ b/web/themes/custom/union_marketing/templates/field/field--node--field-report-pdf--report-summary.html.twig @@ -0,0 +1,41 @@ +{# +/** + * @file + * Theme override for the report pdf link field on report_summary nodes. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * - webform_id: The ID of the webform from the parent node (added in preprocessor). + * + * @see template_preprocess_field() + */ +#} +{% + set classes = [ + 'cu-x-field', + 'field', + 'field-type--' ~ field_type|clean_class, + 'field--label-' ~ label_display, + label_display == 'inline' ? 'clearfix', +] +%} + + {% for item in items %} + {% include '@union/_button.twig' with { + text: item.content['#title'], + url: item.content['#url'], + attributes: {'class': 'cu-button--report cu-colorscheme--vibrant'} + } only %} + {% endfor %} + diff --git a/web/themes/custom/union_marketing/templates/field/field--node--title--report-summary.html.twig b/web/themes/custom/union_marketing/templates/field/field--node--title--report-summary.html.twig new file mode 100644 index 000000000..af646e83c --- /dev/null +++ b/web/themes/custom/union_marketing/templates/field/field--node--title--report-summary.html.twig @@ -0,0 +1,39 @@ +{# +/** + * @file + * Theme override for a report_summary node title field. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * + * @see template_preprocess_field() + */ +#} +{% + set classes = [ + 'cu-heading', + 'field', + 'field--' ~ field_name|clean_class, + 'field-type--' ~ field_type|clean_class, + ] +%} +{# The `_custom` view mode means layout builder. I think. #} +{% if element['#view_mode'] == '_custom' %} +{% for item in items %} +{{ item.content }} +{% endfor %} +{% else %} +{% include "field.html.twig" %} +{% endif %} diff --git a/web/themes/custom/union_marketing/union_marketing.libraries.yml b/web/themes/custom/union_marketing/union_marketing.libraries.yml index 1848d6dfd..351c54375 100644 --- a/web/themes/custom/union_marketing/union_marketing.libraries.yml +++ b/web/themes/custom/union_marketing/union_marketing.libraries.yml @@ -58,6 +58,14 @@ lottie_80years: - core/jquery - union_marketing/lottie +report_summary: + version: 1.x + css: + theme: + css/report-summary.css: {} + dependencies: + - core/drupal + livereload: remote: https://github.com/mklabs/tiny-lr version: 1.1.1 diff --git a/web/themes/custom/union_marketing/union_marketing.theme b/web/themes/custom/union_marketing/union_marketing.theme index 828c99bef..9c9f4f999 100644 --- a/web/themes/custom/union_marketing/union_marketing.theme +++ b/web/themes/custom/union_marketing/union_marketing.theme @@ -149,6 +149,11 @@ function union_marketing_preprocess_node(&$variables) { 'classes' => ['ui-dialog' => 'cu-modal'], ])); } + + // Attach Report Summary CSS library for report_summary content type. + if ($variables['node']->bundle() === 'report_summary') { + $variables['#attached']['library'][] = 'union_marketing/report_summary'; + } } /**