-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ContentOnly mode: Exclude template parts for now #73332
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
ContentOnly mode: Exclude template parts for now #73332
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: -30 B (0%) Total Size: 2.49 MB
ℹ️ View Unchanged
|
|
Since I imagine we'll likely revisit enabling the behaviour for template parts in the future, rather than removing the tests for template parts altogether, I've updated the tests to reflect the behaviour in this PR in d3a1d0d. |
tellthemachines
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM and works as expected!
It would be good to have consistent behaviour across template parts and patterns at some point though, because they are confusingly similar concepts. But this is all a WIP so let's keep iterating 😄
|
Thanks for reviewing!
Indeed, and happy to help revert this revert when we're ready to do so 😄 |
|
Thank you! |
Is there an issue to discuss the nuance, and what needs to be done to make it feel good to use? I don't really understand why Patterns are being considered different to Template Parts. Users might also insert patterns to build a template and those are also content locked. If the friction is a problem then it makes me question the whole idea of applying I don't agree with the idea of this PR, especially given the feature is an experiment still. I don't mind the idea of 1 step backwards, 2 steps forwards, but there needs to be an issue to track the 2 steps forwards. 😄 |
|
Valid pushback. From my perspective, the long term goal is to unify our "editing in isolation" interfaces. By editing in isolation I mean: you click an edit button in a toolbar or an inspector, and you get a focused view of just that element, whether it's a complex block like Navigation or a pattern, or a synced block or template part. We have such a mode, it's engaged by default for template parts when you click edit. With the new contentOnly experiment, there's another, where you click "Edit section" in the inspector, and a situational spotlight-mode is applied to let you delve into just that block in a subtle way. I see both of those being unified. Whether it's only the spotlight-like mechanism, or only the navigate-to-a-separate-page mode, I have less strong feelings about. Speaking mostly about the site/page/template editor now, I understand the latter will continue to exist for editing patterns when navigated to directly. What will happen in the meantime, I think we can plot out a course together: if technically this is a headache as you suggest (1 step backward, 2 steps forward), then perhaps a different approach is needed. From my perspective, the main headache to solve is this one: That there are at present two different ways to edit a template part, and both of them softly conflict insofar as they unlock in different ways, and not always all the way through. One related question there: but is there a way where if I’ve unlocked an ancestor, then every child is unlocked too? If we could make that happen, the "Edit" button on the template part could potentially be set to just engage the spotligt-esque mode. |
The 'Edit section' button should already do that (it looks like it does in your screen cap) so it is or was a little superior, and in my testing with nested patterns it works. My feeling is that we should make the 'Edit' toolbar button engage that mode instead (only when the experiment is active) to reduce the confusingness. If we want to retain access to the isolated/focus mode, maybe we can surface it as a 'Go to template part' option in the block settings dropdown. If we want to make the isolation/focus mode unlock all the blocks, it's a little different, as the entire editor needs to be put into that mode. We'd need to develop that as a new feature. It's not a bad feature to have. |
…emplate parts (#73419) * Revert "ContentOnly mode: Exclude template parts for now (#73332)" This reverts commit 6a93dc6. * Update button to edit/exit * Fix button label with experiment inactive * Fix displaying alternate block patterns when editing a section * Update toolbar button copy to Edit section * Ensure Edit button text is just Edit when experiment disabled ---- Co-authored-by: talldan <[email protected]> Co-authored-by: andrewserong <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: getdave <[email protected]>

What?
Part of #71517
Exclude template parts from content only mode for now (i.e. don't consider template parts a section block)
Why?
This PR is based on some feedback from @jasmussen:
The suggestion was to exclude template parts from this mode for now, as there's more nuance to resolve in getting it to feel good to use, and right now it adds friction to editing headers and footers.
How?
Partially revert #71627 — just those bits that relate to considering a template part a section block.
Testing Instructions
Screenshots or screencast
Before
After