From 69c9066cf6a73524124f0d208dbd8b0eab759f7e Mon Sep 17 00:00:00 2001 From: David Featherston Date: Thu, 4 Jun 2026 11:10:21 +1000 Subject: [PATCH 1/2] feat: add search banner to landing page components --- ...s.paragraphs_type.embedded_search_form.yml | 2 +- .../tests/behat/features/fields.feature | 1 + .../tide_landing_page.install | 34 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/modules/tide_landing_page/config/install/paragraphs.paragraphs_type.embedded_search_form.yml b/modules/tide_landing_page/config/install/paragraphs.paragraphs_type.embedded_search_form.yml index 72a90239a..da30c6b88 100644 --- a/modules/tide_landing_page/config/install/paragraphs.paragraphs_type.embedded_search_form.yml +++ b/modules/tide_landing_page/config/install/paragraphs.paragraphs_type.embedded_search_form.yml @@ -5,5 +5,5 @@ id: embedded_search_form label: 'Search banner' icon_uuid: 02327223-76da-4d72-8c6a-59cb98e760b1 icon_default: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjgiIGhlaWdodD0iNzciIHZpZXdCb3g9IjAgMCA2OCA3NyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjY4IiBoZWlnaHQ9Ijc3IiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB4PSI4IiB5PSIyNiIgd2lkdGg9IjUyIiBoZWlnaHQ9IjI1IiBmaWxsPSJ3aGl0ZSIgc3Ryb2tlPSIjQzRDNEM0IiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTE5Ljk3NzkgMzNDMTcuMjQgMzMgMTUgMzUuMjM0OCAxNSAzNy45NzI3QzE1IDQwLjcxMDUgMTcuMjQgNDIuOTUwNSAxOS45Nzc5IDQyLjk1MDVDMjEuMDMwNSA0Mi45NTA1IDIyLjAwNTMgNDIuNjEzNSAyMi44MDkgNDIuMDUzNUwyNS41MDAyIDQ0LjczOTRDMjUuODQyNCA0NS4wODY5IDI2LjQwMjQgNDUuMDg2OSAyNi43NDQ2IDQ0LjczOTRDMjcuMDg2OSA0NC4zOTcyIDI3LjA4NjkgNDMuODQyNCAyNi43NDQ2IDQzLjUwMDJMMjQuMDUzNSA0MC44MDlDMjQuNjE4NyA0MC4wMDAxIDI0Ljk1MDUgMzkuMDI1MyAyNC45NTA1IDM3Ljk3MjdDMjQuOTUwNSAzNS4yMzQ4IDIyLjcxMDUgMzMgMTkuOTc3OSAzM1YzM1pNMTkuOTc3OSAzNC43NTI2QzIxLjc2MTYgMzQuNzUyNiAyMy4xOTI3IDM2LjE4MzggMjMuMTkyNyAzNy45NzI3QzIzLjE5MjcgMzkuNzYxNiAyMS43NjE2IDQxLjE5MjcgMTkuOTc3OSA0MS4xOTI3QzE4LjE4ODkgNDEuMTkyNyAxNi43NTc4IDM5Ljc2MTYgMTYuNzU3OCAzNy45NzI3QzE2Ljc1NzggMzYuMTgzOCAxOC4xODg5IDM0Ljc1MjYgMTkuOTc3OSAzNC43NTI2VjM0Ljc1MjZaIiBmaWxsPSIjQTFBMUExIi8+Cjwvc3ZnPgo=' -description: 'Display a full-width search bar under the header of your page.' +description: 'Display a search bar allowing users to perform a search.' behavior_plugins: { } diff --git a/modules/tide_landing_page/tests/behat/features/fields.feature b/modules/tide_landing_page/tests/behat/features/fields.feature index 3662522ce..df92c9c66 100644 --- a/modules/tide_landing_page/tests/behat/features/fields.feature +++ b/modules/tide_landing_page/tests/behat/features/fields.feature @@ -80,6 +80,7 @@ Feature: Fields for Landing Page content type And I should see the button "Key dates" And I should see the button "Image gallery" And I should see the button "Complex image" + And I should see the button "Search banner" And I press the "Close" button And I scroll selector "#edit-group-sidebar" into view diff --git a/modules/tide_landing_page/tide_landing_page.install b/modules/tide_landing_page/tide_landing_page.install index f045b135e..16e98ff32 100644 --- a/modules/tide_landing_page/tide_landing_page.install +++ b/modules/tide_landing_page/tide_landing_page.install @@ -473,3 +473,37 @@ function tide_landing_page_update_10114() { ->save(); } } + +/** + * Update the search banner (embedded_search_form) description. + */ +function tide_landing_page_update_10115() { + $config = \Drupal::configFactory()->getEditable('paragraphs.paragraphs_type.embedded_search_form'); + + if ($config->isNew()) { + return; + } + + $config->set('description', 'Display a search bar allowing users to perform a search.'); + $config->save(); +} + +/** + * Add the search banner (embedded_search_form) to landing page components. + */ +function tide_landing_page_update_10116() { + $field = \Drupal::entityTypeManager()->getStorage('field_config')->load('node.landing_page.field_landing_page_component'); + + if (!$field) { + return; + } + + $settings = $field->getSettings(); + + if (!isset($settings['handler_settings']['target_bundles']) || array_key_exists('embedded_search_form', $settings['handler_settings']['target_bundles'])) { + return; + } + + $settings['handler_settings']['target_bundles']['embedded_search_form'] = 'embedded_search_form'; + $field->setSetting($settings)->save(); +} From 26e4a3a51c8d9bd2c93d7f1ad36ef3ef0b6c2600 Mon Sep 17 00:00:00 2001 From: David Featherston Date: Thu, 4 Jun 2026 12:00:40 +1000 Subject: [PATCH 2/2] fix: search banner landing page hook --- modules/tide_landing_page/tide_landing_page.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tide_landing_page/tide_landing_page.install b/modules/tide_landing_page/tide_landing_page.install index 16e98ff32..22f3b1254 100644 --- a/modules/tide_landing_page/tide_landing_page.install +++ b/modules/tide_landing_page/tide_landing_page.install @@ -505,5 +505,5 @@ function tide_landing_page_update_10116() { } $settings['handler_settings']['target_bundles']['embedded_search_form'] = 'embedded_search_form'; - $field->setSetting($settings)->save(); + $field->setSettings($settings)->save(); }