diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 352cefcafc8861..c7b96df855807f 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -900,7 +900,7 @@ Describe in a few words what this site is about. This is important for search re - **Name:** core/site-tagline - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, text), contentRole, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** level, levelOptions, textAlign ## Site Title diff --git a/packages/block-editor/src/store/private-selectors.js b/packages/block-editor/src/store/private-selectors.js index f26f96a5081679..d72503da2555c8 100644 --- a/packages/block-editor/src/store/private-selectors.js +++ b/packages/block-editor/src/store/private-selectors.js @@ -519,8 +519,9 @@ export function isSectionBlock( state, clientId ) { } const attributes = getBlockAttributes( state, clientId ); + const isTemplatePart = blockName === 'core/template-part'; if ( - attributes?.metadata?.patternName && + ( attributes?.metadata?.patternName || isTemplatePart ) && !! window?.__experimentalContentOnlyPatternInsertion ) { return true; @@ -528,7 +529,7 @@ export function isSectionBlock( state, clientId ) { // Template parts become sections in navigation mode. const _isNavigationMode = isNavigationMode( state ); - if ( _isNavigationMode && blockName === 'core/template-part' ) { + if ( _isNavigationMode && isTemplatePart ) { return true; } diff --git a/packages/block-editor/src/store/reducer.js b/packages/block-editor/src/store/reducer.js index 2abbd8547b46f3..f6cd86b57a5957 100644 --- a/packages/block-editor/src/store/reducer.js +++ b/packages/block-editor/src/store/reducer.js @@ -2286,6 +2286,9 @@ function getDerivedBlockEditingModesForTree( const contentOnlyParents = [ ...contentOnlyTemplateLockedClientIds, ...unsyncedPatternClientIds, + ...( window?.__experimentalContentOnlyPatternInsertion + ? templatePartClientIds + : [] ), ]; traverseBlockTree( state, treeClientId, ( block ) => { diff --git a/packages/block-library/src/site-tagline/block.json b/packages/block-library/src/site-tagline/block.json index 1e83e9dded80df..7f94d962e9cbcc 100644 --- a/packages/block-library/src/site-tagline/block.json +++ b/packages/block-library/src/site-tagline/block.json @@ -36,6 +36,7 @@ "text": true } }, + "contentRole": true, "spacing": { "margin": true, "padding": true,