Editor: Use the same PostTemplatePanel between post and site editors#56817
Editor: Use the same PostTemplatePanel between post and site editors#56817youknowriad merged 8 commits intotrunkfrom
Conversation
|
Size Change: +67 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 86d808e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7125538260
|
packages/editor/src/components/post-template/reset-default-template.js
Outdated
Show resolved
Hide resolved
ellatrix
left a comment
There was a problem hiding this comment.
Nice! Love the consistency between editors!
8c92482 to
ecbbbec
Compare
|
Nice, this is working well for me excerpt for one detail; You can create a new template for pages where the template resolves automatically. E.g. if you edit the Posts page when Blog home exists, or if you edit the static homepage when Front page exists. The newly template even appears to get assigned to the page, but the frontend uses the correct template according to the hierarchy resulting in a mismatch. Should we disable new template creation in those scenarios? |
|
@jameskoster Good catch, I think it should be fixed now. |
|
I noticed thanks to the e2e test that this seems to break "custom templates" in classic themes. |
|
Ok Thanks to e2e tests, I had to:
|
|
I still think we need to a bit more tests here. I'm almost certain that this breaks for contributors in the post editor but I don't have time today, I need to disconnect. |
7d311e5 to
86c413d
Compare
|
Working as described for me 🎉
Do you mean the contributor role? If so, I tried creating pending posts as a contributor (who doesn't have access to template actions or the site editor), and then logged in with admin to swap templates and publish and couldn't see any errors. |
andrewserong
left a comment
There was a problem hiding this comment.
Very cool! So nice being able to toggle the template preview within the post editor 🎉
Also, updating the featured image via the Featured Image block in template preview mode updates the image in the Featured image panel and vise versa 👍
2023-12-07.11.59.05.mp4
I haven't run into any major issue so far in testing. One tiny thing I noticed is that in the template preview mode we still output the padding-bottom: 40vh rule, which means that the post appears to extend a bit further vertically than I expected. Is that intentional?
Another tiny thing is the padding / styling on this popover in Classic themes (looks like not quite enough padding on this PR?):
| This PR | Trunk |
|---|---|
![]() |
![]() |
|
Good catch @andrewserong both of these issues should be fixed. |
|
I submitted #57112, which might be an issue related to this PR. |



Related #52632
Builds on top of previous PR that align template modes between post and site editors.
What?
This PR unifies the "template" panel/selectors on the document settings sidebar between the post and site editors. This means
Testing Instructions
Test the different flows related to the template panel in both post and site editors for classic and block themes.