Altera lógica de Site Section e adiciona redirect em content_page

- Adiciona campo field_redirect_link (link) no bundle content_page;
  EventSubscriber emite redirect 301 quando o campo está preenchido
- field_site_section passa a ser obrigatório
- Formulário de content_page: AJAX no site section, select hierárquico
  de página pai filtrado por seção, validação customizada
- StructuralPagesMenuBlock: MAX_DEPTH 10→50, nova lógica de raiz via
  field_site_section, variável ancestor_url no render array
- Template do menu: novas classes BEM/Gva, suporte a is_redirect,
  usa ancestor_url em vez de chamada Twig direta
- CSS do menu reescrito com estilos flyout/sidebar; Select2 adicionado
  para o campo de página pai no formulário admin
- display_submitted desabilitado no tipo content_page

Co-Authored-By: Bauer <henrique@webcontent.com.br>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 08:04:43 -03:00
parent eff3c0122f
commit 36c3a2e9c0
16 changed files with 746 additions and 102 deletions

View File

@@ -1,15 +1,19 @@
langcode: en
uuid: 37d8e6ba-7a46-4b21-b38f-b98a1aaddfed
langcode: pt-br
status: true
dependencies:
config:
- field.field.node.content_page.body
- field.field.node.content_page.field_parent_page
- field.field.node.content_page.field_redirect_link
- field.field.node.content_page.field_site_section
- node.type.content_page
module:
- dynamic_entity_reference
- path
- link
- text
_core:
default_config_hash: tmbpOtX26Afqxu9LxKtH1hZgFGb0MHl1vPy6gR2U8BQ
id: node.content_page.default
targetEntityType: node
bundle: content_page
@@ -17,7 +21,7 @@ mode: default
content:
body:
type: text_textarea_with_summary
weight: 2
weight: 4
region: content
settings:
rows: 9
@@ -27,13 +31,13 @@ content:
third_party_settings: { }
created:
type: datetime_timestamp
weight: 10
weight: 6
region: content
settings: { }
third_party_settings: { }
field_parent_page:
type: dynamic_entity_reference_default
weight: 0
weight: 2
region: content
settings:
match_operator: CONTAINS
@@ -41,42 +45,37 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
field_redirect_link:
type: link_default
weight: 26
region: content
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_site_section:
type: options_select
weight: 1
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 15
langcode:
type: language_select
weight: 3
region: content
settings:
display_label: true
include_locked: 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
weight: 7
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: -5
weight: 0
region: content
settings:
size: 60
@@ -92,4 +91,14 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
hidden:
gva_box_layout: true
gva_breadcrumb: true
gva_header: true
gva_node_class: true
gva_node_layout: true
gva_pagebuilder_content: true
gva_pagebuilder_enable: true
path: true
promote: true
sticky: true

View File

@@ -1,13 +1,24 @@
uuid: dd8e1e8f-7596-4196-a8ae-1bb7c8e5da0a
langcode: en
status: true
dependencies:
config:
- field.field.node.content_page.body
- field.field.node.content_page.field_parent_page
- field.field.node.content_page.field_redirect_link
- field.field.node.content_page.field_site_section
- node.type.content_page
module:
- layout_builder
- link
- text
- user
third_party_settings:
layout_builder:
enabled: false
allow_custom: false
_core:
default_config_hash: yOaQdWIbNqm6bN5B-vKu-rkQvPlfYxQkeHYNXmGlkio
id: node.content_page.default
targetEntityType: node
bundle: content_page
@@ -20,11 +31,20 @@ content:
third_party_settings: { }
weight: 0
region: content
links:
settings: { }
field_redirect_link:
type: link
label: above
settings:
trim_length: 80
url_only: false
url_plain: false
rel: ''
target: ''
third_party_settings: { }
weight: 100
weight: 1
region: content
hidden:
field_parent_page: true
field_site_section: true
langcode: true
links: true

View File

@@ -0,0 +1,23 @@
uuid: 426b6b25-a2f2-4020-8b23-01dc9e82f429
langcode: pt-br
status: true
dependencies:
config:
- field.storage.node.field_redirect_link
- node.type.content_page
module:
- link
id: node.content_page.field_redirect_link
field_name: field_redirect_link
entity_type: node
bundle: content_page
label: 'Redirect Link'
description: ''
required: false
translatable: null
default_value: { }
default_value_callback: ''
settings:
title: 0
link_type: 17
field_type: link

View File

@@ -13,7 +13,7 @@ entity_type: node
bundle: content_page
label: 'Site Section'
description: 'For root pages, select the section. For child pages, this field is filled automatically.'
required: false
required: true
translatable: false
default_value: { }
default_value_callback: ''

View File

@@ -0,0 +1,19 @@
uuid: 6212ce1e-3dfb-48b9-b15c-43f0e8c6fd24
langcode: pt-br
status: true
dependencies:
module:
- link
- node
id: node.field_redirect_link
field_name: field_redirect_link
entity_type: node
type: link
settings: { }
module: link
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -10,4 +10,4 @@ description: 'Pages with hierarchical parent-child structure for content organiz
help: 'For root pages, fill in the Site Section manually. For child pages, select the parent page and the section will be inherited automatically.'
new_revision: true
preview_mode: 1
display_submitted: true
display_submitted: false

View File

@@ -17,3 +17,17 @@ structural_pages.settings:
bundle:
type: string
label: 'Bundle'
block.settings.structural_pages_menu:
type: block_settings
label: 'Structural Pages Menu Block'
mapping:
max_depth:
type: integer
label: 'Maximum depth'
show_ancestor_title:
type: boolean
label: 'Show ancestor title'
expand_active_trail:
type: boolean
label: 'Expand active trail'