From 93f889336f803b670e14588aee719090744f00d4 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Wed, 3 Dec 2025 00:06:35 -0500 Subject: [PATCH 01/27] fix: #3554907 restore non book bundle solution to wxt-6.1.x By: joseph.olstad --- composer.json | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 03faf09e..2b252bf4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "drupal/autosave_form": "^1.7", "drupal/block_class": "^4.0.1", "drupal/blog": "^3.1", - "drupal/book": "^2.0", + "drupal/book": "2.0.x-dev#09a40d4e as 2.0.3", "drupal/bootstrap_layouts": "^5.4", "drupal/button_link": "2.0.x-dev@dev", "drupal/ckeditor_abbreviation": "^5.0", @@ -219,6 +219,14 @@ "3500238 - Rename tests to fix core phpunit kernel tests": "https://www.drupal.org/files/issues/2025-08-20/3500238-core-11.1.8--16.patch" }, + "drupal/book": { + "3554905 - Clean full backport of 3.0.x to 2.0.x with D10.4.x+ and D11.1.x+ compatibility.": + "https://git.drupalcode.org/project/book/-/merge_requests/136.diff" + }, + "drupal/ckeditor_details": { + "3244311 - Allow
element to be placed without
": + "https://www.drupal.org/files/issues/2024-11-15/3244311-9.patch" + }, "drupal/ctools": { "Enter drupal/ctools patch #2667652 description here": "https://www.drupal.org/files/issues/ctools-option_to_expose-2667652-3.patch", @@ -271,9 +279,9 @@ "Enter drupal/webform patch #3205860 description here": "https://www.drupal.org/files/issues/2021-03-26/webform_clientside_validation-3205860-2.patch" }, - "drupal/ckeditor_details": { - "3244311 - Allow
element to be placed without
": - "https://www.drupal.org/files/issues/2024-11-15/3244311-9.patch" + "drupalwxt/wxt_bootstrap": { + "3554907 - WxT Bootstrap patch for upgraded book module support.": + "https://www.drupal.org/files/issues/2025-11-12/wxt_bootstrap-3554907-03.patch" } } }, From 5962d6a26d620f148cccbec6225c680849688294 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Wed, 3 Dec 2025 00:09:03 -0500 Subject: [PATCH 02/27] fix: #3554907 restore non book bundle solution to wxt-6.1.x By: joseph.olstad Update wxt_ext_book.module --- .../wxt_ext/wxt_ext_book/wxt_ext_book.module | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module index fe253f0b..c8bd43a9 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module +++ b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module @@ -14,8 +14,8 @@ function wxt_ext_book_preprocess_page(&$variables) { $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof NodeInterface) { - if (!empty($node->book)) { - + $book_array = $node->getBook(); + if (!empty($book_array)) { $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); if ($node->hasTranslation($language)) { @@ -23,7 +23,7 @@ function wxt_ext_book_preprocess_page(&$variables) { } // If book child page. - if ($node->book['bid'] != $node->id()) { + if ($book_array['bid'] != $node->id()) { $config = [ 'label_display' => '0', 'block_mode' => 'book pages', @@ -32,14 +32,14 @@ function wxt_ext_book_preprocess_page(&$variables) { $block = \Drupal::service('plugin.manager.block')->createInstance('book_navigation', $config); $variables['book_navigation'] = $block->build(); - $book = \Drupal::entityTypeManager()->getStorage('node')->load($node->book['bid']); + $book = \Drupal::entityTypeManager()->getStorage('node')->load($book_array['bid']); if ($book instanceof NodeInterface) { if ($book->hasTranslation($language)) { $book = $book->getTranslation($language); } - $book_title = $book->getTitle(); + $book_title = $book->label(); $variables['book_title'] = $book_title; } } @@ -54,10 +54,11 @@ function wxt_ext_book_preprocess_book_navigation(&$variables) { $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof NodeInterface) { - if (!empty($node->book)) { + $book_array = $node->getBook(); + if (!empty($book_array)) { $config = \Drupal::config('wxt_ext_book.settings'); - if ($node->book['bid'] == $node->id()) { + if ($book_array['bid'] == $node->id()) { // Current page is the book index. $variables['is_book_index'] = TRUE; @@ -131,8 +132,11 @@ function _wxt_ext_book_set_variables_recursive(&$items, $active_nid) { function wxt_ext_book_preprocess_page_title(&$variables) { $node = \Drupal::routeMatch()->getParameter('node'); - if ($node instanceof NodeInterface && !empty($node->book)) { - $variables['is_book'] = TRUE; + if ($node instanceof NodeInterface) { + if (!empty($book_array)) { + $book_array = $node->getBook(); + $variables['is_book'] = TRUE; + } } } From 58e8225cfe2847fffc7d5667469ebc17a8294ef8 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Wed, 3 Dec 2025 00:10:15 -0500 Subject: [PATCH 03/27] fix: #3554907 restore non book bundle solution to wxt-6.1.x By: joseph.olstad Schema updates relating to upstream book module changes. --- .../wxt_ext_book/config/rewrite/node.type.book.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml index 0bc003bd..283cd64f 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml @@ -2,20 +2,20 @@ config_rewrite: replace langcode: en status: true dependencies: - enforced: - module: - - book module: - menu_ui + - wxt_ext_workflow third_party_settings: menu_ui: available_menus: - main parent: 'main:' + wxt_ext_workflow: + workflow: editorial name: 'Book page' type: book description: 'Books have a built-in hierarchical navigation (GC Subway).' -help: '' +help: null new_revision: true preview_mode: 1 display_submitted: false From c7dd80df5a0ef28f4b4c09d07fc8f144ef0462b8 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Wed, 3 Dec 2025 00:11:26 -0500 Subject: [PATCH 04/27] fix: #3554907 restore non book bundle solution to wxt-6.1.x By: joseph.olstad Schema changes relating to upstream settings structure updates, expand option here. --- .../wxt_ext_book/config/rewrite/book.settings.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml index 457feceb..cd44e55b 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml @@ -1,5 +1,10 @@ -allowed_type_book: 1 -block: - navigation: - mode: 'all pages' -child_type_book: book +allowed_types: + - + content_type: book + child_type: book + - + content_type: landing_page + child_type: landing_page +book_sort: weight +truncate_label: true +use_parent_selector: true From 16376d1a2fefd419cefc10524b9fb3204f4af00c Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Thu, 4 Dec 2025 18:21:13 -0500 Subject: [PATCH 05/27] Update composer.json switch from MR to patch --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2b252bf4..04ee88ef 100644 --- a/composer.json +++ b/composer.json @@ -221,7 +221,7 @@ }, "drupal/book": { "3554905 - Clean full backport of 3.0.x to 2.0.x with D10.4.x+ and D11.1.x+ compatibility.": - "https://git.drupalcode.org/project/book/-/merge_requests/136.diff" + "https://www.drupal.org/files/issues/2025-12-04/book-3554905-backport-3x.patch" }, "drupal/ckeditor_details": { "3244311 - Allow
element to be placed without
": From 5a7960bfba79e12d91a49bb079f546f186126470 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Thu, 4 Dec 2025 19:16:23 -0500 Subject: [PATCH 06/27] fix: #3554907 restore book solution to wxt-6.1.x By: joseph.olstad --- composer.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/composer.json b/composer.json index 04ee88ef..05c8d8a8 100644 --- a/composer.json +++ b/composer.json @@ -278,10 +278,6 @@ "drupal/webform": { "Enter drupal/webform patch #3205860 description here": "https://www.drupal.org/files/issues/2021-03-26/webform_clientside_validation-3205860-2.patch" - }, - "drupalwxt/wxt_bootstrap": { - "3554907 - WxT Bootstrap patch for upgraded book module support.": - "https://www.drupal.org/files/issues/2025-11-12/wxt_bootstrap-3554907-03.patch" } } }, From ee48434b58f64ca7c23f3a1ce34fd658a9fa41cb Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Thu, 4 Dec 2025 19:21:13 -0500 Subject: [PATCH 07/27] Update wxt_ext_book.module --- modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module index c8bd43a9..5681a02a 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module +++ b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.module @@ -133,8 +133,8 @@ function wxt_ext_book_preprocess_page_title(&$variables) { $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof NodeInterface) { + $book_array = $node->getBook(); if (!empty($book_array)) { - $book_array = $node->getBook(); $variables['is_book'] = TRUE; } } From 1d9d59e4b9e83e826c0ddba8ed2495fd336bc033 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:18:52 -0500 Subject: [PATCH 08/27] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 05c8d8a8..2c566a1c 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "drupal/autosave_form": "^1.7", "drupal/block_class": "^4.0.1", "drupal/blog": "^3.1", - "drupal/book": "2.0.x-dev#09a40d4e as 2.0.3", + "drupal/book": "2.0.3", "drupal/bootstrap_layouts": "^5.4", "drupal/button_link": "2.0.x-dev@dev", "drupal/ckeditor_abbreviation": "^5.0", @@ -221,7 +221,7 @@ }, "drupal/book": { "3554905 - Clean full backport of 3.0.x to 2.0.x with D10.4.x+ and D11.1.x+ compatibility.": - "https://www.drupal.org/files/issues/2025-12-04/book-3554905-backport-3x.patch" + "https://www.drupal.org/files/issues/2025-12-05/book-3554905-backport-3x.patch" }, "drupal/ckeditor_details": { "3244311 - Allow
element to be placed without
": From 8559afa978f9778d339492ba4fac31d82e7a5608 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:29:23 -0500 Subject: [PATCH 09/27] Update composer.json Remove book patch, switch to livre instead --- composer.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 2c566a1c..4781266b 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ "drupal/autosave_form": "^1.7", "drupal/block_class": "^4.0.1", "drupal/blog": "^3.1", - "drupal/book": "2.0.3", "drupal/bootstrap_layouts": "^5.4", "drupal/button_link": "2.0.x-dev@dev", "drupal/ckeditor_abbreviation": "^5.0", @@ -51,6 +50,7 @@ "drupal/layout_builder_styles": "^2.1", "drupal/layout_library": "^1.0@beta", "drupal/linkit": "^7.0", + "drupal/livre": "^1.0.2", "drupal/media_entity_instagram": "^4.0@beta", "drupal/media_entity_twitter": "^2.10", "drupal/media_entity_slideshow": "^2.6", @@ -219,10 +219,6 @@ "3500238 - Rename tests to fix core phpunit kernel tests": "https://www.drupal.org/files/issues/2025-08-20/3500238-core-11.1.8--16.patch" }, - "drupal/book": { - "3554905 - Clean full backport of 3.0.x to 2.0.x with D10.4.x+ and D11.1.x+ compatibility.": - "https://www.drupal.org/files/issues/2025-12-05/book-3554905-backport-3x.patch" - }, "drupal/ckeditor_details": { "3244311 - Allow
element to be placed without
": "https://www.drupal.org/files/issues/2024-11-15/3244311-9.patch" From 0dc9fc7adf46aa16e8445dddc7b5266f9038b9b7 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:19:25 -0500 Subject: [PATCH 10/27] Delete wxt_ext_book/config/rewrite/node.type.book.yml since it's no longer needed, any bundle is supported by book now No longer need to rewrite book bundle since book bundle isn't required and is no longer provided by the book module 3.0.x --- .../config/rewrite/node.type.book.yml | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml deleted file mode 100644 index 283cd64f..00000000 --- a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/node.type.book.yml +++ /dev/null @@ -1,21 +0,0 @@ -config_rewrite: replace -langcode: en -status: true -dependencies: - module: - - menu_ui - - wxt_ext_workflow -third_party_settings: - menu_ui: - available_menus: - - main - parent: 'main:' - wxt_ext_workflow: - workflow: editorial -name: 'Book page' -type: book -description: 'Books have a built-in hierarchical navigation (GC Subway).' -help: null -new_revision: true -preview_mode: 1 -display_submitted: false From e7c14cab873fcdd562fb280d48b9019e6df9e9a7 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:20:27 -0500 Subject: [PATCH 11/27] Update language.content_settings.node.book.yml default to landing_page --- .../config/optional/language.content_settings.node.book.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml index 8bfa3d44..f3154bda 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - node.type.book + - node.type.landing_page module: - content_translation third_party_settings: content_translation: enabled: true -id: node.book +id: node.landing_page target_entity_type_id: node -target_bundle: book +target_bundle: landing_page default_langcode: site_default language_alterable: false From 6746a0fabdbae95cb8a5c3550f5fe840cd36361d Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:21:07 -0500 Subject: [PATCH 12/27] Update book.settings.yml no longer requires 'book' --- .../wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml index cd44e55b..73345ddc 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml @@ -1,7 +1,4 @@ allowed_types: - - - content_type: book - child_type: book - content_type: landing_page child_type: landing_page From 7dc45236c5c179cf14d0f505a70d07ab0dde2fd4 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:25:51 -0500 Subject: [PATCH 13/27] Rename language.content_settings.node.book.yml to language.content_settings.node.landing_page.yml book -> landing_page --- ...e.book.yml => language.content_settings.node.landing_page.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/custom/wxt_ext/wxt_ext_book/config/optional/{language.content_settings.node.book.yml => language.content_settings.node.landing_page.yml} (100%) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.landing_page.yml similarity index 100% rename from modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml rename to modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.landing_page.yml From bc48c382af2411459e39da2922620bb2d26e742b Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:56:46 -0500 Subject: [PATCH 14/27] Create node.type.book.yml --- .../config/optional/node.type.book.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/node.type.book.yml diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/node.type.book.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/node.type.book.yml new file mode 100644 index 00000000..feab13a1 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/node.type.book.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + - wxt_ext_workflow +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' + wxt_ext_workflow: + workflow: editorial +name: 'Book page' +type: book +description: 'Books have a built-in hierarchical navigation (GC Subway).' +help: null +new_revision: true +preview_mode: 1 +display_submitted: false From ec6cf2f7036645dbbaecac04e93037165ff69c7c Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:57:14 -0500 Subject: [PATCH 15/27] Update and rename language.content_settings.node.landing_page.yml to language.content_settings.node.book.yml --- ...ing_page.yml => language.content_settings.node.book.yml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename modules/custom/wxt_ext/wxt_ext_book/config/optional/{language.content_settings.node.landing_page.yml => language.content_settings.node.book.yml} (74%) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.landing_page.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml similarity index 74% rename from modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.landing_page.yml rename to modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml index f3154bda..8bfa3d44 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.landing_page.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/language.content_settings.node.book.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - node.type.landing_page + - node.type.book module: - content_translation third_party_settings: content_translation: enabled: true -id: node.landing_page +id: node.book target_entity_type_id: node -target_bundle: landing_page +target_bundle: book default_langcode: site_default language_alterable: false From 22aff22234c86b88b6dab59c5885f5365422ef06 Mon Sep 17 00:00:00 2001 From: olstjos <75325509+olstjos@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:57:52 -0500 Subject: [PATCH 16/27] Update book.settings.yml book --- .../wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml index 73345ddc..cd44e55b 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml @@ -1,4 +1,7 @@ allowed_types: + - + content_type: book + child_type: book - content_type: landing_page child_type: landing_page From 17ee72b59666322f510dab271b4491f7f96907fa Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Tue, 9 Dec 2025 14:43:29 -0500 Subject: [PATCH 17/27] feat: #3554907 restore book solution to wxt-6.1.x By: joseph.olstad By: smulvih2 --- .../config/install/wxt_ext_book.settings.yml | 2 +- ....entity_form_display.node.book.default.yml | 96 ++++++++++++++ ...ore.entity_view_display.node.book.full.yml | 124 ++++++++++++++++++ .../optional/field.field.node.book.body.yml | 29 ++++ .../config/optional/pathauto.pattern.book.yml | 23 ++++ .../wxt_ext_book/wxt_ext_book.tokens.inc | 96 ++++++++++++++ 6 files changed, 369 insertions(+), 1 deletion(-) create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_form_display.node.book.default.yml create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/pathauto.pattern.book.yml create mode 100644 modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml b/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml index 59c77fba..e1dd2844 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml @@ -1,4 +1,4 @@ navigation: persistent_nav: 1 page_title_nav_labels: 1 - page_nav_home_link: 0 + page_nav_home_link: 1 diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_form_display.node.book.default.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_form_display.node.book.default.yml new file mode 100644 index 00000000..7b0a0980 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_form_display.node.book.default.yml @@ -0,0 +1,96 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.book.body + - node.type.book + - workflows.workflow.editorial + module: + - content_moderation + - path + - text +id: node.book.default +targetEntityType: node +bundle: book +mode: default +content: + body: + type: text_textarea_with_summary + weight: 1 + region: content + settings: + rows: 5 + summary_rows: 2 + placeholder: '' + show_summary: false + third_party_settings: { } + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + moderation_state: + type: moderation_state_default + weight: 100 + region: content + settings: { } + third_party_settings: { } + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + weight: 15 + region: content + settings: + display_label: true + third_party_settings: { } + status: + type: boolean_checkbox + weight: 120 + region: content + settings: + display_label: true + third_party_settings: { } + sticky: + type: boolean_checkbox + weight: 16 + region: content + settings: + display_label: true + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + translation: + weight: 10 + region: content + settings: { } + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } +hidden: { } diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml new file mode 100644 index 00000000..39492ba4 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml @@ -0,0 +1,124 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.full + - field.field.node.book.body + - node.type.book + module: + - bootstrap_layouts + - layout_builder + - layout_discovery + - layout_library + - text + - user +third_party_settings: + layout_builder: + enabled: true + allow_custom: false + sections: + - + layout_id: layout_onecol + layout_settings: + label: '' + components: + a6a77cb9-5ce3-46ba-8c0d-bddafc87fce5: + uuid: a6a77cb9-5ce3-46ba-8c0d-bddafc87fce5 + region: content + configuration: + id: 'extra_field_block:node:book:content_moderation_control' + label_display: '0' + context_mapping: + entity: layout_builder.entity + weight: 0 + additional: { } + f1d6ab5d-4531-4061-b90d-766c806e9ceb: + uuid: f1d6ab5d-4531-4061-b90d-766c806e9ceb + region: content + configuration: + id: 'extra_field_block:node:book:links' + label_display: '0' + context_mapping: + entity: layout_builder.entity + weight: 1 + additional: { } + 00f097fe-a6e5-4467-9d3c-2a1dacd2a827: + uuid: 00f097fe-a6e5-4467-9d3c-2a1dacd2a827 + region: content + configuration: + id: 'field_block:node:book:body' + label_display: '0' + context_mapping: + entity: layout_builder.entity + formatter: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 2 + additional: { } + third_party_settings: { } + - + layout_id: bs_1col + layout_settings: + label: '' + context_mapping: { } + layout: + wrapper: div + classes: + row: row + add_layout_class: 1 + attributes: class|container + regions: + main: + wrapper: div + classes: + col-sm-12: col-sm-12 + add_region_classes: 1 + attributes: '' + components: + 0eade8e1-27b0-4519-9287-610ab4abd46a: + uuid: 0eade8e1-27b0-4519-9287-610ab4abd46a + region: main + configuration: + id: 'extra_field_block:node:book:book_navigation' + label: 'Book navigation' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + settings: { } + third_party_settings: { } + weight: 0 + additional: { } + third_party_settings: { } + layout_library: + enable: false +id: node.book.full +targetEntityType: node +bundle: book +mode: full +content: + body: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 101 + region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + book_navigation: true + footnotes_group: true + langcode: true + search_api_excerpt: true diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml new file mode 100644 index 00000000..face8c80 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - filter.format.footnote + - filter.format.full_html + - filter.format.rich_text + - node.type.book + module: + - text +id: node.book.body +field_name: body +entity_type: node +bundle: book +label: Description +description: 'A description of this page, for use in teasers and lists of content.' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: false + required_summary: false + allowed_formats: + - rich_text + - full_html + - footnote +field_type: text_with_summary diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/pathauto.pattern.book.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/pathauto.pattern.book.yml new file mode 100644 index 00000000..6066062b --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/pathauto.pattern.book.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + module: + - node +id: book +label: Book +type: 'canonical_entities:node' +pattern: '[node:book:parents:join-path]/[node:title]' +selection_criteria: + de676eda-f1c9-4740-8f70-f4b1dc2943c1: + id: 'entity_bundle:node' + negate: false + uuid: de676eda-f1c9-4740-8f70-f4b1dc2943c1 + context_mapping: + node: node + bundles: + book: book +selection_logic: and +weight: -10 +relationships: + 'node:langcode:language': + label: Language diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc new file mode 100644 index 00000000..4f7bed84 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc @@ -0,0 +1,96 @@ + [ + 'node' => [ + 'name' => t('Node'), + 'description' => t('Node tokens extended for Livre/Book 3.x.'), + ], + ], + 'tokens' => [ + 'node' => [ + 'book:parents:join-path' => [ + 'name' => t('Book parents joined as path'), + 'description' => t('Titles of ancestor book pages, joined as a path.'), + ], + ], + ], + ]; +} + +/** + * Implements hook_tokens(). + */ +function wxt_ext_book_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { + + $replacements = []; + + if ($type !== 'node' || empty($data['node']) || !$data['node'] instanceof NodeInterface) { + return $replacements; + } + + /** @var \Drupal\node\NodeInterface $node */ + $node = $data['node']; + + /** @var \Drupal\book\BookManagerInterface $book_manager */ + $book_manager = \Drupal::service('book.manager'); + + // 1. Load book link for THIS node. + $book_link = $book_manager->loadBookLink($node->id()); + + if (!$book_link) { + // Not part of a book. + return $replacements; + } + + // 2. Load the parent link if pid > 0. + $parent_link = []; + if (!empty($book_link['pid'])) { + $parent_link = $book_manager->loadBookLink($book_link['pid']) ?: []; + } + + // 3. Get parent chain array. + $parents = $book_manager->getBookParents($book_link, $parent_link); + // Expecting parents array: ['depth'=>X, 'p1'=>nid, 'p2'=>nid, ...]. + + $depth = $parents['depth'] ?? 0; + + // 4. Build clean path segments from ancestor titles. + $titles = []; + if ($depth > 0) { + $node_storage = \Drupal::entityTypeManager()->getStorage('node'); + $cleaner = \Drupal::service('pathauto.alias_cleaner'); + + $current_nid = $node->id(); + + for ($i = 1; $i <= $depth; $i++) { + $key = 'p' . $i; + + if (!empty($parents[$key]) && $parents[$key] != $current_nid) { + if ($parent = $node_storage->load($parents[$key])) { + $titles[] = $cleaner->cleanString($parent->label()); + } + } + } + } + + // The final joined path. + $joined_path = implode('/', $titles); + + foreach ($tokens as $name => $original) { + if ($name === 'book:parents:join-path') { + $replacements[$original] = $joined_path; + } + } + + return $replacements; +} + From 60ce76562dc2b5505c35f6ce8dc4a20df5fc44e0 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Wed, 10 Dec 2025 14:51:25 -0500 Subject: [PATCH 18/27] fix: #3554907 restore book solution to wxt-6.1.x By: joseph.olstad By: smulvih2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4781266b..2957831b 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "drupal/layout_builder_styles": "^2.1", "drupal/layout_library": "^1.0@beta", "drupal/linkit": "^7.0", - "drupal/livre": "^1.0.2", + "drupal/livre": "^1.0.3", "drupal/media_entity_instagram": "^4.0@beta", "drupal/media_entity_twitter": "^2.10", "drupal/media_entity_slideshow": "^2.6", From e66ea0ea7ba86fb44c993037200e276e7f03edc0 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Thu, 11 Dec 2025 14:18:43 -0500 Subject: [PATCH 19/27] feat: #3554907 Sane book default for landing_page book option when installing wxt_ext_book module By: joseph.olstad By: smulvih2 --- ...view_display.node.landing_page.default.yml | 43 +++++++ ....layout.node_landing_page_full_default.yml | 118 ++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml new file mode 100644 index 00000000..09a430a5 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml @@ -0,0 +1,43 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.landing_page.body + - field.field.node.landing_page.field_meta_tags + - field.field.node.landing_page.field_queue + - field.field.node.landing_page.layout_builder__layout + - field.field.node.landing_page.layout_builder__translation + - field.field.node.landing_page.layout_selection + - node.type.landing_page + module: + - user +id: node.landing_page.default +targetEntityType: node +bundle: landing_page +mode: default +content: + book_navigation: + settings: { } + third_party_settings: { } + weight: 101 + region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + body: true + field_meta_tags: true + field_queue: true + footnotes_group: true + langcode: true + layout_builder__layout: true + layout_builder__translation: true + layout_selection: true + search_api_excerpt: true diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml new file mode 100644 index 00000000..2ede57c8 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml @@ -0,0 +1,118 @@ +langcode: en +status: true +dependencies: { } +id: node_landing_page_full_default +label: 'Single Column' +targetEntityType: node +targetBundle: landing_page +layout: + - + layout_id: bs_1col + layout_settings: + label: '' + layout: + wrapper: div + classes: + row: row + add_layout_class: 1 + attributes: '' + regions: + main: + wrapper: div + classes: + col-sm-12: col-sm-12 + add_region_classes: 1 + attributes: '' + components: + 398ddd2d-fe84-40e8-9120-37bc2e866efa: + uuid: 398ddd2d-fe84-40e8-9120-37bc2e866efa + region: main + configuration: + id: page_title_block + label: 'Page title' + label_display: '0' + provider: core + context_mapping: { } + weight: -1 + additional: { } + d32f81b0-722f-4094-9397-e508fce0be86: + uuid: d32f81b0-722f-4094-9397-e508fce0be86 + region: main + configuration: + id: local_tasks_block + label: Tabs + label_display: '0' + provider: core + context_mapping: { } + primary: true + secondary: true + weight: 0 + additional: { } + 53c78586-ebb9-4749-b0f4-7b0846043c9d: + uuid: 53c78586-ebb9-4749-b0f4-7b0846043c9d + region: main + configuration: + id: 'field_block:node:landing_page:body' + label: Body + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 1 + additional: { } + third_party_settings: { } + - + layout_id: bs_1col + layout_settings: + label: '' + context_mapping: { } + layout: + wrapper: div + classes: + row: row + add_layout_class: 1 + attributes: class|container + regions: + main: + wrapper: div + classes: + col-sm-12: col-sm-12 + add_region_classes: 1 + attributes: '' + components: + c51990d5-bbd0-43aa-ae53-244bca862d9a: + uuid: c51990d5-bbd0-43aa-ae53-244bca862d9a + region: main + configuration: + id: 'extra_field_block:node:landing_page:book_navigation' + label: 'Book navigation' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + settings: { } + third_party_settings: { } + weight: 1 + additional: { } + d341464b-8b0e-4d56-ac06-7642ce6361d9: + uuid: d341464b-8b0e-4d56-ac06-7642ce6361d9 + region: main + configuration: + id: 'extra_field_block:node:landing_page:links' + label: 'Book Links' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + settings: { } + third_party_settings: { } + weight: 0 + additional: { } + third_party_settings: { } From 2a35991ecb1ea5aaddb45a6aa86dc618c76b1cd1 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Thu, 11 Dec 2025 15:11:06 -0500 Subject: [PATCH 20/27] feat: #3554907 Sane book default for landing_page book option when installing wxt_ext_book module By: joseph.olstad By: smulvih2 --- ...ty_view_display.node.landing_page.full.yml | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml new file mode 100644 index 00000000..9fca77f2 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml @@ -0,0 +1,184 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.full + - field.field.node.landing_page.body + - field.field.node.landing_page.field_meta_tags + - field.field.node.landing_page.field_queue + - field.field.node.landing_page.layout_builder__layout + - field.field.node.landing_page.layout_builder__translation + - field.field.node.landing_page.layout_selection + - node.type.landing_page + - system.menu.account + module: + - bootstrap_layouts + - layout_builder + - layout_library + - metatag + - system + - user +third_party_settings: + layout_builder: + enabled: true + allow_custom: true + sections: + - + layout_id: bs_2col_bricked + layout_settings: + label: '' + layout: + wrapper: div + classes: + row: row + add_layout_class: 1 + attributes: '' + regions: + top: + wrapper: div + classes: + col-sm-12: col-sm-12 + add_region_classes: 1 + attributes: 'class|mrgn-tp-lg,class|mrgn-bttm-lg' + top_left: + wrapper: div + classes: + col-md-3: col-md-3 + add_region_classes: 1 + attributes: '' + top_right: + wrapper: div + classes: + col-md-9: col-md-9 + add_region_classes: 1 + attributes: '' + middle: + wrapper: div + classes: + col-sm-12: col-sm-12 + add_region_classes: 1 + attributes: '' + bottom_left: + wrapper: div + classes: + col-sm-6: col-sm-6 + add_region_classes: 1 + attributes: '' + bottom_right: + wrapper: div + classes: + col-sm-6: col-sm-6 + add_region_classes: 1 + attributes: '' + bottom: + wrapper: div + classes: + col-sm-12: col-sm-12 + add_region_classes: 1 + attributes: '' + components: + 62dd7b94-9f49-4b61-ad40-f65d365a7f46: + uuid: 62dd7b94-9f49-4b61-ad40-f65d365a7f46 + region: top_right + configuration: + id: page_title_block + label: 'Page title' + label_display: '0' + provider: core + context_mapping: { } + weight: 0 + additional: { } + e58e904b-8890-4559-9582-222b7ca445a9: + uuid: e58e904b-8890-4559-9582-222b7ca445a9 + region: top_right + configuration: + id: local_tasks_block + label: Tabs + label_display: '0' + provider: core + context_mapping: { } + primary: true + secondary: true + weight: 1 + additional: { } + 2ba0359c-af3f-4bd7-a6d6-a6e93f680883: + uuid: 2ba0359c-af3f-4bd7-a6d6-a6e93f680883 + region: top_right + configuration: + id: 'field_block:node:landing_page:body' + label: Body + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 2 + additional: { } + e18fc4d1-7588-47ae-97b7-69379a6f2e0d: + uuid: e18fc4d1-7588-47ae-97b7-69379a6f2e0d + region: top_left + configuration: + id: 'system_menu_block:account' + label: 'User account menu' + label_display: visible + provider: system + context_mapping: { } + level: 1 + depth: 0 + expand_all_items: false + weight: -1 + additional: { } + 5ccf0fe1-f2f4-4fad-be69-3b0b285eb944: + uuid: 5ccf0fe1-f2f4-4fad-be69-3b0b285eb944 + region: bottom + configuration: + id: 'extra_field_block:node:landing_page:book_navigation' + label: 'Book navigation' + label_display: visible + provider: layout_builder + context_mapping: + entity: layout_builder.entity + formatter: + settings: { } + third_party_settings: { } + weight: 0 + additional: { } + third_party_settings: { } + layout_library: + enable: true +id: node.landing_page.full +targetEntityType: node +bundle: landing_page +mode: full +content: + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content + field_meta_tags: + type: metatag_empty_formatter + label: above + settings: { } + third_party_settings: { } + weight: 101 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + body: true + book_navigation: true + field_queue: true + footnotes_group: true + langcode: true + layout_builder__layout: true + layout_builder__translation: true + layout_selection: true + search_api_excerpt: true From 865e567dd8ff60185bd66e76f2f6495a215b0a07 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Thu, 11 Dec 2025 15:43:57 -0500 Subject: [PATCH 21/27] feat: #3554907 Sane book default for landing_page book option when installing wxt_ext_book module By: joseph.olstad --- ...ty_view_display.node.landing_page.full.yml | 8 +-- ..._view_display.node.landing_page.teaser.yml | 49 +++++++++++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml index 9fca77f2..03116835 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml @@ -132,13 +132,13 @@ third_party_settings: expand_all_items: false weight: -1 additional: { } - 5ccf0fe1-f2f4-4fad-be69-3b0b285eb944: - uuid: 5ccf0fe1-f2f4-4fad-be69-3b0b285eb944 - region: bottom + e933b822-1b12-4811-9821-4b950ec6a800: + uuid: e933b822-1b12-4811-9821-4b950ec6a800 + region: middle configuration: id: 'extra_field_block:node:landing_page:book_navigation' label: 'Book navigation' - label_display: visible + label_display: '0' provider: layout_builder context_mapping: entity: layout_builder.entity diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml new file mode 100644 index 00000000..6e80dc72 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml @@ -0,0 +1,49 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.landing_page.body + - field.field.node.landing_page.field_meta_tags + - field.field.node.landing_page.field_queue + - field.field.node.landing_page.layout_builder__layout + - field.field.node.landing_page.layout_builder__translation + - field.field.node.landing_page.layout_selection + - node.type.landing_page + module: + - metatag + - text + - user +id: node.landing_page.teaser +targetEntityType: node +bundle: landing_page +mode: teaser +content: + body: + type: text_summary_or_trimmed + label: hidden + settings: + trim_length: 600 + third_party_settings: { } + weight: 0 + region: content + field_meta_tags: + type: metatag_empty_formatter + label: hidden + settings: { } + third_party_settings: { } + weight: 2 + region: content + links: + settings: { } + third_party_settings: { } + weight: 1 + region: content +hidden: + book_navigation: true + field_queue: true + footnotes_group: true + langcode: true + layout_builder__layout: true + layout_builder__translation: true + layout_selection: true From 4b553a7b9684532a1fe3751ce639462577c37982 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Thu, 11 Dec 2025 17:31:39 -0500 Subject: [PATCH 22/27] Trim unneeded config. --- ...view_display.node.landing_page.default.yml | 43 ---------------- ..._view_display.node.landing_page.teaser.yml | 49 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml delete mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml deleted file mode 100644 index 09a430a5..00000000 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.default.yml +++ /dev/null @@ -1,43 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.landing_page.body - - field.field.node.landing_page.field_meta_tags - - field.field.node.landing_page.field_queue - - field.field.node.landing_page.layout_builder__layout - - field.field.node.landing_page.layout_builder__translation - - field.field.node.landing_page.layout_selection - - node.type.landing_page - module: - - user -id: node.landing_page.default -targetEntityType: node -bundle: landing_page -mode: default -content: - book_navigation: - settings: { } - third_party_settings: { } - weight: 101 - region: content - content_moderation_control: - settings: { } - third_party_settings: { } - weight: -20 - region: content - links: - settings: { } - third_party_settings: { } - weight: 100 - region: content -hidden: - body: true - field_meta_tags: true - field_queue: true - footnotes_group: true - langcode: true - layout_builder__layout: true - layout_builder__translation: true - layout_selection: true - search_api_excerpt: true diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml deleted file mode 100644 index 6e80dc72..00000000 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.teaser.yml +++ /dev/null @@ -1,49 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.landing_page.body - - field.field.node.landing_page.field_meta_tags - - field.field.node.landing_page.field_queue - - field.field.node.landing_page.layout_builder__layout - - field.field.node.landing_page.layout_builder__translation - - field.field.node.landing_page.layout_selection - - node.type.landing_page - module: - - metatag - - text - - user -id: node.landing_page.teaser -targetEntityType: node -bundle: landing_page -mode: teaser -content: - body: - type: text_summary_or_trimmed - label: hidden - settings: - trim_length: 600 - third_party_settings: { } - weight: 0 - region: content - field_meta_tags: - type: metatag_empty_formatter - label: hidden - settings: { } - third_party_settings: { } - weight: 2 - region: content - links: - settings: { } - third_party_settings: { } - weight: 1 - region: content -hidden: - book_navigation: true - field_queue: true - footnotes_group: true - langcode: true - layout_builder__layout: true - layout_builder__translation: true - layout_selection: true From 69d754319677127c7d484bc08e7995219b457e92 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Fri, 12 Dec 2025 00:59:41 -0500 Subject: [PATCH 23/27] feat: #3554907 Sane book default for landing_page book option when installing/upgrading the wxt_ext_book module. --- ...ty_view_display.node.landing_page.full.yml | 184 ------------- ....layout.node_landing_page_full_default.yml | 118 -------- .../wxt_ext/wxt_ext_book/wxt_ext_book.install | 260 ++++++++++++++++++ 3 files changed, 260 insertions(+), 302 deletions(-) delete mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml delete mode 100644 modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml create mode 100644 modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml deleted file mode 100644 index 03116835..00000000 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.landing_page.full.yml +++ /dev/null @@ -1,184 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.full - - field.field.node.landing_page.body - - field.field.node.landing_page.field_meta_tags - - field.field.node.landing_page.field_queue - - field.field.node.landing_page.layout_builder__layout - - field.field.node.landing_page.layout_builder__translation - - field.field.node.landing_page.layout_selection - - node.type.landing_page - - system.menu.account - module: - - bootstrap_layouts - - layout_builder - - layout_library - - metatag - - system - - user -third_party_settings: - layout_builder: - enabled: true - allow_custom: true - sections: - - - layout_id: bs_2col_bricked - layout_settings: - label: '' - layout: - wrapper: div - classes: - row: row - add_layout_class: 1 - attributes: '' - regions: - top: - wrapper: div - classes: - col-sm-12: col-sm-12 - add_region_classes: 1 - attributes: 'class|mrgn-tp-lg,class|mrgn-bttm-lg' - top_left: - wrapper: div - classes: - col-md-3: col-md-3 - add_region_classes: 1 - attributes: '' - top_right: - wrapper: div - classes: - col-md-9: col-md-9 - add_region_classes: 1 - attributes: '' - middle: - wrapper: div - classes: - col-sm-12: col-sm-12 - add_region_classes: 1 - attributes: '' - bottom_left: - wrapper: div - classes: - col-sm-6: col-sm-6 - add_region_classes: 1 - attributes: '' - bottom_right: - wrapper: div - classes: - col-sm-6: col-sm-6 - add_region_classes: 1 - attributes: '' - bottom: - wrapper: div - classes: - col-sm-12: col-sm-12 - add_region_classes: 1 - attributes: '' - components: - 62dd7b94-9f49-4b61-ad40-f65d365a7f46: - uuid: 62dd7b94-9f49-4b61-ad40-f65d365a7f46 - region: top_right - configuration: - id: page_title_block - label: 'Page title' - label_display: '0' - provider: core - context_mapping: { } - weight: 0 - additional: { } - e58e904b-8890-4559-9582-222b7ca445a9: - uuid: e58e904b-8890-4559-9582-222b7ca445a9 - region: top_right - configuration: - id: local_tasks_block - label: Tabs - label_display: '0' - provider: core - context_mapping: { } - primary: true - secondary: true - weight: 1 - additional: { } - 2ba0359c-af3f-4bd7-a6d6-a6e93f680883: - uuid: 2ba0359c-af3f-4bd7-a6d6-a6e93f680883 - region: top_right - configuration: - id: 'field_block:node:landing_page:body' - label: Body - label_display: '0' - provider: layout_builder - context_mapping: - entity: layout_builder.entity - formatter: - type: text_default - label: hidden - settings: { } - third_party_settings: { } - weight: 2 - additional: { } - e18fc4d1-7588-47ae-97b7-69379a6f2e0d: - uuid: e18fc4d1-7588-47ae-97b7-69379a6f2e0d - region: top_left - configuration: - id: 'system_menu_block:account' - label: 'User account menu' - label_display: visible - provider: system - context_mapping: { } - level: 1 - depth: 0 - expand_all_items: false - weight: -1 - additional: { } - e933b822-1b12-4811-9821-4b950ec6a800: - uuid: e933b822-1b12-4811-9821-4b950ec6a800 - region: middle - configuration: - id: 'extra_field_block:node:landing_page:book_navigation' - label: 'Book navigation' - label_display: '0' - provider: layout_builder - context_mapping: - entity: layout_builder.entity - formatter: - settings: { } - third_party_settings: { } - weight: 0 - additional: { } - third_party_settings: { } - layout_library: - enable: true -id: node.landing_page.full -targetEntityType: node -bundle: landing_page -mode: full -content: - content_moderation_control: - settings: { } - third_party_settings: { } - weight: -20 - region: content - field_meta_tags: - type: metatag_empty_formatter - label: above - settings: { } - third_party_settings: { } - weight: 101 - region: content - links: - settings: { } - third_party_settings: { } - weight: 100 - region: content -hidden: - body: true - book_navigation: true - field_queue: true - footnotes_group: true - langcode: true - layout_builder__layout: true - layout_builder__translation: true - layout_selection: true - search_api_excerpt: true diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml deleted file mode 100644 index 2ede57c8..00000000 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/layout_library.layout.node_landing_page_full_default.yml +++ /dev/null @@ -1,118 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: node_landing_page_full_default -label: 'Single Column' -targetEntityType: node -targetBundle: landing_page -layout: - - - layout_id: bs_1col - layout_settings: - label: '' - layout: - wrapper: div - classes: - row: row - add_layout_class: 1 - attributes: '' - regions: - main: - wrapper: div - classes: - col-sm-12: col-sm-12 - add_region_classes: 1 - attributes: '' - components: - 398ddd2d-fe84-40e8-9120-37bc2e866efa: - uuid: 398ddd2d-fe84-40e8-9120-37bc2e866efa - region: main - configuration: - id: page_title_block - label: 'Page title' - label_display: '0' - provider: core - context_mapping: { } - weight: -1 - additional: { } - d32f81b0-722f-4094-9397-e508fce0be86: - uuid: d32f81b0-722f-4094-9397-e508fce0be86 - region: main - configuration: - id: local_tasks_block - label: Tabs - label_display: '0' - provider: core - context_mapping: { } - primary: true - secondary: true - weight: 0 - additional: { } - 53c78586-ebb9-4749-b0f4-7b0846043c9d: - uuid: 53c78586-ebb9-4749-b0f4-7b0846043c9d - region: main - configuration: - id: 'field_block:node:landing_page:body' - label: Body - label_display: '0' - provider: layout_builder - context_mapping: - entity: layout_builder.entity - formatter: - type: text_default - label: hidden - settings: { } - third_party_settings: { } - weight: 1 - additional: { } - third_party_settings: { } - - - layout_id: bs_1col - layout_settings: - label: '' - context_mapping: { } - layout: - wrapper: div - classes: - row: row - add_layout_class: 1 - attributes: class|container - regions: - main: - wrapper: div - classes: - col-sm-12: col-sm-12 - add_region_classes: 1 - attributes: '' - components: - c51990d5-bbd0-43aa-ae53-244bca862d9a: - uuid: c51990d5-bbd0-43aa-ae53-244bca862d9a - region: main - configuration: - id: 'extra_field_block:node:landing_page:book_navigation' - label: 'Book navigation' - label_display: '0' - provider: layout_builder - context_mapping: - entity: layout_builder.entity - formatter: - settings: { } - third_party_settings: { } - weight: 1 - additional: { } - d341464b-8b0e-4d56-ac06-7642ce6361d9: - uuid: d341464b-8b0e-4d56-ac06-7642ce6361d9 - region: main - configuration: - id: 'extra_field_block:node:landing_page:links' - label: 'Book Links' - label_display: '0' - provider: layout_builder - context_mapping: - entity: layout_builder.entity - formatter: - settings: { } - third_party_settings: { } - weight: 0 - additional: { } - third_party_settings: { } diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install new file mode 100644 index 00000000..095a2c37 --- /dev/null +++ b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install @@ -0,0 +1,260 @@ +getStorage('entity_view_display'); + $display = $storage->load('node.landing_page.full'); + + if (!$display || !$display instanceof LayoutEntityDisplayInterface) { + return; + } + + $lb = $display->getThirdPartySettings('layout_builder'); + if (empty($lb['enabled'])) { + return; + } + + // Idempotent: if any section already contains BOTH components, do nothing. + foreach ($display->getSections() as $section) { + if (_wxt_ext_book_section_has_component_id($section, 'extra_field_block:node:landing_page:links') && + _wxt_ext_book_section_has_component_id($section, 'extra_field_block:node:landing_page:book_navigation')) { + return; + } + } + + $new_section = _wxt_ext_book_build_bs_1col_container_section(); + $new_section->appendComponent(_wxt_ext_book_build_extra_field_component( + 'extra_field_block:node:landing_page:links', + 'Links', + 0 + )); + $new_section->appendComponent(_wxt_ext_book_build_extra_field_component( + 'extra_field_block:node:landing_page:book_navigation', + 'Book navigation', + 1 + )); + + // Insert after the original section (index 0). If no sections exist, insert at 0. + $insert_index = count($display->getSections()) > 0 ? 1 : 0; + + // Your class supports insertSection() (you verified). + $display->insertSection($insert_index, $new_section); + $display->save(); +} + +/** + * Insert a new bs_1col section at index 1 on layout library template. + */ +function _wxt_ext_book_patch_layout_library(EntityTypeManagerInterface $etm): void { + $config_name = 'layout_library.layout.node_landing_page_full_default'; + $config = \Drupal::configFactory()->getEditable($config_name); + + // If it doesn't exist yet, bail. + if ($config->isNew()) { + return; + } + + $layout_array = $config->get('layout') ?? []; + if (!is_array($layout_array)) { + $layout_array = []; + } + + // Idempotent check. + $already = FALSE; + foreach ($layout_array as $section_array) { + $components = $section_array['components'] ?? []; + $has_links = FALSE; + $has_book_nav = FALSE; + foreach ($components as $c) { + $id = $c['configuration']['id'] ?? ''; + $has_links = $has_links || ($id === 'extra_field_block:node:landing_page:links'); + $has_book_nav = $has_book_nav || ($id === 'extra_field_block:node:landing_page:book_navigation'); + } + if ($has_links && $has_book_nav) { + $already = TRUE; + break; + } + } + + if ($already) { + return; + } + + $new_section = _wxt_ext_book_build_bs_1col_container_section_array_with_components(); + $insert_index = count($layout_array) > 0 ? 1 : 0; + array_splice($layout_array, $insert_index, 0, [$new_section]); + + $config->set('layout', $layout_array); + $config->save(); + +} + +/** + * Build a bs_1col Layout Builder Section matching your YAML. + */ +function _wxt_ext_book_build_bs_1col_container_section(): Section { + return new Section('bs_1col', [ + 'label' => '', + 'context_mapping' => [], + 'layout' => [ + 'wrapper' => 'div', + 'classes' => [ + 'row' => 'row', + ], + 'add_layout_class' => 1, + 'attributes' => 'class|container', + ], + 'regions' => [ + 'main' => [ + 'wrapper' => 'div', + 'classes' => [ + 'col-sm-12' => 'col-sm-12', + ], + 'add_region_classes' => 1, + 'attributes' => '', + ], + ], + ]); +} + +/** + * Build a Layout Builder component for an extra field block. + */ +function _wxt_ext_book_build_extra_field_component(string $plugin_id, string $label, int $weight): SectionComponent { + $uuid = \Drupal::service('uuid')->generate(); + + $component = new SectionComponent($uuid, 'main', [ + 'id' => $plugin_id, + 'label' => $label, + 'label_display' => '0', + 'provider' => 'layout_builder', + 'context_mapping' => [ + 'entity' => 'layout_builder.entity', + ], + 'formatter' => [ + 'settings' => [], + 'third_party_settings' => [], + ], + ]); + $component->setWeight($weight); + + return $component; +} + +/** + * Helper: check whether a Section already contains a component id. + */ +function _wxt_ext_book_section_has_component_id(Section $section, string $plugin_id): bool { + foreach ($section->getComponents() as $component) { + $conf = $component->get('configuration'); + if (($conf['id'] ?? '') === $plugin_id) { + return TRUE; + } + } + return FALSE; +} + +/** + * Build the layout library section as an array with both components. + */ +function _wxt_ext_book_build_bs_1col_container_section_array_with_components(): array { + $uuid_links = \Drupal::service('uuid')->generate(); + $uuid_book = \Drupal::service('uuid')->generate(); + + return [ + 'layout_id' => 'bs_1col', + 'layout_settings' => [ + 'label' => '', + 'context_mapping' => [], + 'layout' => [ + 'wrapper' => 'div', + 'classes' => [ + 'row' => 'row', + ], + 'add_layout_class' => 1, + 'attributes' => 'class|container', + ], + 'regions' => [ + 'main' => [ + 'wrapper' => 'div', + 'classes' => [ + 'col-sm-12' => 'col-sm-12', + ], + 'add_region_classes' => 1, + 'attributes' => '', + ], + ], + ], + 'components' => [ + $uuid_links => [ + 'uuid' => $uuid_links, + 'region' => 'main', + 'configuration' => [ + 'id' => 'extra_field_block:node:landing_page:links', + 'label' => 'Links', + 'label_display' => '0', + 'provider' => 'layout_builder', + 'context_mapping' => [ + 'entity' => 'layout_builder.entity', + ], + 'formatter' => [ + 'settings' => [], + 'third_party_settings' => [], + ], + ], + 'weight' => 0, + 'additional' => [], + ], + $uuid_book => [ + 'uuid' => $uuid_book, + 'region' => 'main', + 'configuration' => [ + 'id' => 'extra_field_block:node:landing_page:book_navigation', + 'label' => 'Book navigation', + 'label_display' => '0', + 'provider' => 'layout_builder', + 'context_mapping' => [ + 'entity' => 'layout_builder.entity', + ], + 'formatter' => [ + 'settings' => [], + 'third_party_settings' => [], + ], + ], + 'weight' => 1, + 'additional' => [], + ], + ], + 'third_party_settings' => [], + ]; +} From 484b4338173552a43d2fdbbe9f17d3c2985677a6 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Sun, 14 Dec 2025 13:49:11 -0500 Subject: [PATCH 24/27] feat: #3554907 Token support is included now with livre 1.0.4, move it from wxt_ext_book into livre 1.0.4. By: joseph.olstad By: smulvih2 --- composer.json | 2 +- .../wxt_ext_book/wxt_ext_book.tokens.inc | 96 ------------------- 2 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc diff --git a/composer.json b/composer.json index 2957831b..a53ced6c 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "drupal/layout_builder_styles": "^2.1", "drupal/layout_library": "^1.0@beta", "drupal/linkit": "^7.0", - "drupal/livre": "^1.0.3", + "drupal/livre": "^1.0", "drupal/media_entity_instagram": "^4.0@beta", "drupal/media_entity_twitter": "^2.10", "drupal/media_entity_slideshow": "^2.6", diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc deleted file mode 100644 index 4f7bed84..00000000 --- a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.tokens.inc +++ /dev/null @@ -1,96 +0,0 @@ - [ - 'node' => [ - 'name' => t('Node'), - 'description' => t('Node tokens extended for Livre/Book 3.x.'), - ], - ], - 'tokens' => [ - 'node' => [ - 'book:parents:join-path' => [ - 'name' => t('Book parents joined as path'), - 'description' => t('Titles of ancestor book pages, joined as a path.'), - ], - ], - ], - ]; -} - -/** - * Implements hook_tokens(). - */ -function wxt_ext_book_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { - - $replacements = []; - - if ($type !== 'node' || empty($data['node']) || !$data['node'] instanceof NodeInterface) { - return $replacements; - } - - /** @var \Drupal\node\NodeInterface $node */ - $node = $data['node']; - - /** @var \Drupal\book\BookManagerInterface $book_manager */ - $book_manager = \Drupal::service('book.manager'); - - // 1. Load book link for THIS node. - $book_link = $book_manager->loadBookLink($node->id()); - - if (!$book_link) { - // Not part of a book. - return $replacements; - } - - // 2. Load the parent link if pid > 0. - $parent_link = []; - if (!empty($book_link['pid'])) { - $parent_link = $book_manager->loadBookLink($book_link['pid']) ?: []; - } - - // 3. Get parent chain array. - $parents = $book_manager->getBookParents($book_link, $parent_link); - // Expecting parents array: ['depth'=>X, 'p1'=>nid, 'p2'=>nid, ...]. - - $depth = $parents['depth'] ?? 0; - - // 4. Build clean path segments from ancestor titles. - $titles = []; - if ($depth > 0) { - $node_storage = \Drupal::entityTypeManager()->getStorage('node'); - $cleaner = \Drupal::service('pathauto.alias_cleaner'); - - $current_nid = $node->id(); - - for ($i = 1; $i <= $depth; $i++) { - $key = 'p' . $i; - - if (!empty($parents[$key]) && $parents[$key] != $current_nid) { - if ($parent = $node_storage->load($parents[$key])) { - $titles[] = $cleaner->cleanString($parent->label()); - } - } - } - } - - // The final joined path. - $joined_path = implode('/', $titles); - - foreach ($tokens as $name => $original) { - if ($name === 'book:parents:join-path') { - $replacements[$original] = $joined_path; - } - } - - return $replacements; -} - From 14ce1955acbc5516b70e546712a2989d3ff185c6 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Sun, 14 Dec 2025 14:10:38 -0500 Subject: [PATCH 25/27] Book next/prev buttons should not use book title label, just prev/next, drop home, and drop container class. --- .../wxt_ext_book/config/install/wxt_ext_book.settings.yml | 4 ++-- .../optional/core.entity_view_display.node.book.full.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml b/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml index e1dd2844..f8fdf924 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/install/wxt_ext_book.settings.yml @@ -1,4 +1,4 @@ navigation: persistent_nav: 1 - page_title_nav_labels: 1 - page_nav_home_link: 1 + page_title_nav_labels: 0 + page_nav_home_link: 0 diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml index 39492ba4..9a47d8ec 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/core.entity_view_display.node.book.full.yml @@ -68,7 +68,7 @@ third_party_settings: classes: row: row add_layout_class: 1 - attributes: class|container + attributes: '' regions: main: wrapper: div From caa7ddbd189140b9236ccc86908a7a11f71cbba1 Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Sun, 14 Dec 2025 14:17:56 -0500 Subject: [PATCH 26/27] Book next/prev buttons should not use book title label, just prev/next, drop home, and drop container class. --- modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install index 095a2c37..0cb6f841 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install +++ b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install @@ -132,7 +132,7 @@ function _wxt_ext_book_build_bs_1col_container_section(): Section { 'row' => 'row', ], 'add_layout_class' => 1, - 'attributes' => 'class|container', + 'attributes' => '', ], 'regions' => [ 'main' => [ @@ -202,7 +202,7 @@ function _wxt_ext_book_build_bs_1col_container_section_array_with_components(): 'row' => 'row', ], 'add_layout_class' => 1, - 'attributes' => 'class|container', + 'attributes' => '', ], 'regions' => [ 'main' => [ From e6c3cf876bc87660d3f8644a100bbc7a75c275cc Mon Sep 17 00:00:00 2001 From: "joseph.olstad" Date: Fri, 2 Jan 2026 00:20:23 -0500 Subject: [PATCH 27/27] Switch from landing_page to page for book. --- .../optional/field.field.node.book.body.yml | 4 +-- .../config/rewrite/book.settings.yml | 4 +-- .../wxt_ext/wxt_ext_book/wxt_ext_book.install | 30 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml b/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml index face8c80..d80c5a4d 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/optional/field.field.node.book.body.yml @@ -13,8 +13,8 @@ id: node.book.body field_name: body entity_type: node bundle: book -label: Description -description: 'A description of this page, for use in teasers and lists of content.' +label: Body +description: 'A description for this book page.' required: true translatable: true default_value: { } diff --git a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml index cd44e55b..4a58f57d 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml +++ b/modules/custom/wxt_ext/wxt_ext_book/config/rewrite/book.settings.yml @@ -3,8 +3,8 @@ allowed_types: content_type: book child_type: book - - content_type: landing_page - child_type: landing_page + content_type: page + child_type: page book_sort: weight truncate_label: true use_parent_selector: true diff --git a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install index 0cb6f841..1a9af73c 100644 --- a/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install +++ b/modules/custom/wxt_ext/wxt_ext_book/wxt_ext_book.install @@ -9,19 +9,19 @@ use Drupal\layout_builder\SectionComponent; * Implements hook_install(). */ function wxt_ext_book_install(): void { - _wxt_ext_book_apply_landing_page_book_nav_layouts(); + _wxt_ext_book_apply_page_book_nav_layouts(); } function wxt_ext_book_update_10001(): void { - // Set up sane layout library and display full configuration for a Landing Page book. + // Set up sane layout library and display full configuration for a Basic Page book. wxt_ext_book_install(); } /** - * Apply the landing_page Layout Builder + Layout Library changes. + * Apply the basic page Layout Builder + Layout Library changes. * * Safe to run multiple times. */ -function _wxt_ext_book_apply_landing_page_book_nav_layouts(): void { +function _wxt_ext_book_apply_page_book_nav_layouts(): void { $etm = \Drupal::entityTypeManager(); _wxt_ext_book_patch_view_display($etm); @@ -29,11 +29,11 @@ function _wxt_ext_book_apply_landing_page_book_nav_layouts(): void { } /** - * Insert a new bs_1col section at index 1 on node.landing_page.full. + * Insert a new bs_1col section at index 1 on node.page.full. */ function _wxt_ext_book_patch_view_display(EntityTypeManagerInterface $etm): void { $storage = $etm->getStorage('entity_view_display'); - $display = $storage->load('node.landing_page.full'); + $display = $storage->load('node.page.full'); if (!$display || !$display instanceof LayoutEntityDisplayInterface) { return; @@ -46,20 +46,20 @@ function _wxt_ext_book_patch_view_display(EntityTypeManagerInterface $etm): void // Idempotent: if any section already contains BOTH components, do nothing. foreach ($display->getSections() as $section) { - if (_wxt_ext_book_section_has_component_id($section, 'extra_field_block:node:landing_page:links') && - _wxt_ext_book_section_has_component_id($section, 'extra_field_block:node:landing_page:book_navigation')) { + if (_wxt_ext_book_section_has_component_id($section, 'extra_field_block:node:page:links') && + _wxt_ext_book_section_has_component_id($section, 'extra_field_block:node:page:book_navigation')) { return; } } $new_section = _wxt_ext_book_build_bs_1col_container_section(); $new_section->appendComponent(_wxt_ext_book_build_extra_field_component( - 'extra_field_block:node:landing_page:links', + 'extra_field_block:node:page:links', 'Links', 0 )); $new_section->appendComponent(_wxt_ext_book_build_extra_field_component( - 'extra_field_block:node:landing_page:book_navigation', + 'extra_field_block:node:page:book_navigation', 'Book navigation', 1 )); @@ -76,7 +76,7 @@ function _wxt_ext_book_patch_view_display(EntityTypeManagerInterface $etm): void * Insert a new bs_1col section at index 1 on layout library template. */ function _wxt_ext_book_patch_layout_library(EntityTypeManagerInterface $etm): void { - $config_name = 'layout_library.layout.node_landing_page_full_default'; + $config_name = 'layout_library.layout.node_page_full_default'; $config = \Drupal::configFactory()->getEditable($config_name); // If it doesn't exist yet, bail. @@ -97,8 +97,8 @@ function _wxt_ext_book_patch_layout_library(EntityTypeManagerInterface $etm): vo $has_book_nav = FALSE; foreach ($components as $c) { $id = $c['configuration']['id'] ?? ''; - $has_links = $has_links || ($id === 'extra_field_block:node:landing_page:links'); - $has_book_nav = $has_book_nav || ($id === 'extra_field_block:node:landing_page:book_navigation'); + $has_links = $has_links || ($id === 'extra_field_block:node:page:links'); + $has_book_nav = $has_book_nav || ($id === 'extra_field_block:node:page:book_navigation'); } if ($has_links && $has_book_nav) { $already = TRUE; @@ -220,7 +220,7 @@ function _wxt_ext_book_build_bs_1col_container_section_array_with_components(): 'uuid' => $uuid_links, 'region' => 'main', 'configuration' => [ - 'id' => 'extra_field_block:node:landing_page:links', + 'id' => 'extra_field_block:node:page:links', 'label' => 'Links', 'label_display' => '0', 'provider' => 'layout_builder', @@ -239,7 +239,7 @@ function _wxt_ext_book_build_bs_1col_container_section_array_with_components(): 'uuid' => $uuid_book, 'region' => 'main', 'configuration' => [ - 'id' => 'extra_field_block:node:landing_page:book_navigation', + 'id' => 'extra_field_block:node:page:book_navigation', 'label' => 'Book navigation', 'label_display' => '0', 'provider' => 'layout_builder',