From f9273f5e8fbeba8229ff4d7024c0d254cf7cbc0e Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 29 Jul 2024 11:28:25 +0200 Subject: [PATCH 1/2] Site Editor: Try adding a warning for templates that can not be previewed --- packages/edit-site/src/components/editor/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index b11a9c56c9c50..3dfd0ee32af55 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -22,6 +22,7 @@ import { store as noticesStore } from '@wordpress/notices'; import { privateApis as routerPrivateApis } from '@wordpress/router'; import { store as preferencesStore } from '@wordpress/preferences'; import { decodeEntities } from '@wordpress/html-entities'; +import { Warning } from '@wordpress/block-editor'; /** * Internal dependencies @@ -185,6 +186,11 @@ export default function EditSiteEditor( { isPostsList = false } ) { { isEditMode && } + { ! isReady && ! editedPostType && ( + + { __( 'The template can not be previewed.' ) } + + ) } { ! isReady ? : null } { isEditMode && } { isReady && ( From a85d7ce2a98e49392ef6730540c5a7ba2afdc4d5 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 1 Aug 2024 07:34:23 +0200 Subject: [PATCH 2/2] Update the message and simplify the two conditions --- .../edit-site/src/components/editor/index.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index 2b586350d4eb5..41c35f23eb068 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -218,12 +218,18 @@ export default function EditSiteEditor( { isPostsList = false } ) { { isEditMode && } - { ! isReady && ! editedPostType && ( - - { __( 'The template can not be previewed.' ) } - - ) } - { ! isReady ? : null } + { ! isReady ? ( + <> + { ! editedPostType && ( + + { __( + 'The template you are currently using is not compatible with the Site Editor.' + ) } + + ) } + + + ) : null } { isEditMode && } { isReady && (