In #25739 we temporarily removed the "overwrite/revert" functionality from the new template navigation sidebar.
We want to put it back ASAP, but we need to figure out a clearer way to handle it.
cc @epiqueras @shaunandrews @jameskoster
See:
The original TemplateSwitcher worked roughly like this:
index template with the "all posts" content.index, but it can be overwritten into a new category-foo template.index template.singular, but it can be overwritten into a new page-bar template.singular template.| All Posts | Single Page (default template) | Single Page (custom template) |
| - | - | - |
|
|
|
|
I've personally always found this behaviour hard to understand, but in the interest of retaining the same behavior in the new template sidebar, we should figure out where to put the "Overwrite Template" and "Revert to Parent" button.
For context, this is how the sidebar looks like right now:
| All Posts | Single Page (default template) | Single Page (custom template) |
| - | - | - |
|
|
|
(note: this is a submenu) |
Add the Overwrite button under the default template, and the Revert button under the specific template.
The Revert button might appear in a nested submenu.
Add both button under the default template, indicating that that template is the target of both actions.
Add both buttons in the "root" Templates menu, in a location unrelated to their target.
Add both buttons _outside_ of the menu (still in the sidebar), and differentiate them from the menu (e.g. buttons with a different color). Maybe we could add context in the button label itself. E.g.
I'd love to hear more thoughts on this, but my opinion is that neither of these actions should live in the sidebar, as they are not navigational in nature.
I see four common/related use cases around these behaviours that we need to design for:
There are probably others that I'm missing :)
Due to the overlap in these actions they should probably appear in close proximity in the UI. A simple popover menu feels like a good candidate as we may need to display these actions (and others in the future) in multiple locations โ potentially outside of the Editor even. Two quick examples of that:
Circling back to the use cases above, here are some design options of how we might present these actions in the Editor:




Hopefully these design concepts illustrate their portability to other areas of site management, such as the template mosaic view, or category management screens that I alluded to above.
I'd love to hear more thoughts on this, but my opinion is that neither of these actions should live in the sidebar, as they are not navigational in nature.
I agree with this. ๐ฏ
I'm editing content and want to create a new template for this piece of content
I really like how template selection and creation is exposed through the content here. As a side note, given that only entities that can be navigated to via sidebar appear in the top title (templates, template parts), this could be viewed as one point in favor of also exposing content selection through the sidebar too.
this could be viewed as one point in favor of also exposing content selection through the sidebar too.
Which sidebar do you mean, left or right? ๐ I wouldn't rule out putting content selection in the nav sidebar, but my gut says it might feel a bit awkward.
Another option would be to put it in the template menus above. Kind of like an inverse of the template selector in the document menu.
| Template menu | Document menu |
|---|---|
|
|
|
We can explore this more in the relevant issue :)
Which sidebar do you mean, left or right? ๐ I wouldn't rule out putting content selection in the nav sidebar, but my gut says it might feel a bit awkward.
Yes, I meant the nav sidebar. ๐
Related: #26284