In my demo of What’s new in WordPress 6.2 we noted a couple of problems with the Site Editor and Block Editor. While some of them could be attributed to ignorance and misunderstanding of how to use the new version, and may not necessarily be considered worthy of further work, others were more problematic.
Which template should I be editing?
The first problem I had was with not knowing which template was being displayed in the Template preview.
Even when you’ve selected the Templates menu, the current item isn’t hilighted. Clicking on the template itself opens up the editor. But I was clicking on the Home menu item and being taken to a different template.
Having watched the video recording of the meeting I’ve managed to recreate the scenario. And what happens does make sense.
I know now that I should have been choosing Page rather than Home. My front page is called Home, but that’s not the name of the template used to display it.
The template for the Site Front Page, in the absence of
front-page.html and several other possible options in the template hierarchy, is
The template for the Blog Posts Index page is
For more information on the WordPress template hierarchy see https://developer.wordpress.org/themes/basics/template-hierarchy/.
Note that this hasn’t been updated for block based themes, but that the basic logic of template selection is the same as for classic themes.
With 3 years experience of developing block based themes, I should have known better. I wonder how many other people will get confused?
Choosing to edit page versus clicking on the main body
Later on in the video I actually selected the Page menu item. Again I got a different result from what I expected.
I expected to be editing the Page template displaying the home page, as seen in the first image.
Instead I was editing the page template out of context. Which meant I didn’t see the featured image or post content from the home page in the Site Editor.
Use apply styles globally with caution
We discovered that applying styles globally is not a good idea for the heading block.
- The padding disappeared
- My changes to a heading level 2 was applied to all heading levels.
After applying globally
There’s a known problem to which this might be related. https://github.com/WordPress/gutenberg/issues/49070
Note: Switching styles by clicking on a different variation in the Site Editor’s Styles tab will reset any changes you made to global styles for the previously selected variation.
This is not a new issue. See https://github.com/WordPress/gutenberg/issues/38333 and https://github.com/WordPress/gutenberg/issues/40561
There are a number of issues associated with Global Styles. For more information see Global Styles Ongoing Roadmap.