-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing template editor from a post or page no longer edits in context of that post or page #60695
Comments
Hey @maxmorgan 👋 Thanks for your report here. I'm sorry to say that this is not in fact a regression in the sense that this was a change made on purpose. There was a lot of feedback in previous versions of this flow that it is too confusing/difficult to know when you are editing something that is a part of the template vs something that is part of the current post. So it led to many unintentional template edits that broke sites. Because of that, the experience was split into these two distinct editing modes. The However, I do agree that it is very beneficial to have actual content visible whilst editing a template instead of just seeing the post content blocks placeholder text. @ellatrix @youknowriad @noisysocks @talldan @richtabor I wonder whether it makes sense for us to add an additional mode that works similarly to |
My instinct is that that would be confusing to the majority of users, but I defer to @SaxonF and @jameskoster. I recall at one point we discussed having the ability to select which post was being previewed in the View dropdown. |
I agree that by not showing any content the separation between template and content is more obvious. This is particularly helpful for folks who are less familiar with how templates work (which is most people). But eventually it would be nice to support both. IE when editing a template you can view it abstracted (template-only), contextually based on referrer (edit page -> edit template), or with a specific, compatible record loaded in.
There's an issue for that one here: #28466, but it hasn't been updated in a long time. |
I'm not sure I agree with the sentiment that it necessarily is more confusing to showcase the content in a locked mode. The reason why I think that is because it often is quite important to see how differently aligned elements, regular content width, wide & full align, right & left align etc. render in a template. And currently, there is no way to really see that unless you jump back and forth. Because of that I think it would either be good to improve the placeholder state of the post content to have some more representative data in it. Or to move forward with a mode that enables this preview :) |
They might be part of the same solution. Preview options being;
They're all useful in different scenarios... |
I think with the "show preview" toggle that is now being more visible in the "preview" dropdown, we can consider this issue resolved. "Editing the template with a given post visible" is still not possible but providing that context is tracked here #28466 |
Description
We've noticed since upgrading from 6.4.3 to 6.5.2 that there's a behavioral change when entering a template editor directly from a page or post. Previously, this would open the editor with the page or post used as a source of truth for content. Now, it always opens with placeholder content as if we were entering from the site editor.
The previous behavior was advantageous as it gave a 'truer' representation of how our templates look and feel with our real content and gave us a better opportunity to test layout changes with real custom field data.
WordPress documentation also shows off the previous behavior when discussing template editing for posts, so so this seems like a regression.
https://wordpress.org/documentation/article/template-editor/#to-edit-a-template
(See the video captioned "Editing an existing page template"
Step-by-step reproduction instructions
Steps to reproduce:
Expected behavior:
Actual behavior:
I've also attached a video of a fresh/brand new installation using 2024 theme and just one single plugin (Pods) to demonstrate why the previous (expected behavior) was useful.
Screenshots, screen recording, code snippet
Demonstration Video:
https://youtu.be/jVd09xEyFI8
Before:
After:
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: