Skip to content
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

Site Editor: Overwrite and Revert Templates #25872

Closed
Copons opened this issue Oct 6, 2020 · 6 comments
Closed

Site Editor: Overwrite and Revert Templates #25872

Copons opened this issue Oct 6, 2020 · 6 comments
Labels
[Feature] Navigation Component A navigational waterfall component for hierarchy of items. Needs Design Feedback Needs general design feedback.

Comments

@Copons
Copy link
Contributor

Copons commented Oct 6, 2020

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

Original Behavior

See:

The original TemplateSwitcher worked roughly like this:

  • The default state is the default index template with the "all posts" content.
  • Changing content would give the opportunity of "overwriting" the relative default template, by creating a new content-specific template.
    E.g.
    • Select the category Foo as content: the template is now index, but it can be overwritten into a new category-foo template.
      Once overwritten, it can be reverted to the default index template.
    • Select the page Bar as content: the template is now singular, but it can be overwritten into a new page-bar template.
      Once overwritten, it can be reverted to the default singular template.
All Posts Single Page (default template) Single Page (custom template)
Screenshot 2020-10-06 at 18 52 08 Screenshot 2020-10-06 at 18 52 22 Screenshot 2020-10-06 at 18 52 30

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)
Screenshot 2020-10-06 at 18 55 35 Screenshot 2020-10-06 at 18 57 11 Screenshot 2020-10-06 at 18 55 53 (note: this is a submenu)

Possible Options

  • 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.

    • Instead of "Overwrite Template" -> "Overwrite index template".
    • Instead of "Revert to Parent" -> "Revert to index template".
@Copons Copons added [Feature] Full Site Editing [Feature] Navigation Component A navigational waterfall component for hierarchy of items. labels Oct 6, 2020
@jameskoster
Copy link
Contributor

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:

  1. I'm editing content and want to create a new template for this piece of content
  2. I want to create a new template based on an existing template
  3. I want to revert a template back to the theme default
  4. I want to delete one of my custom templates

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:

  1. I should be able to delete my custom template from the template mosaic view, or while editing it directly.
  2. I should be able to create a new template for a specific post category, while editing that category.

Circling back to the use cases above, here are some design options of how we might present these actions in the Editor:

I'm editing content and want to create a new template for this piece of content

1

I want to create a new template based on an existing template

2

I want to revert a template back to the theme default

3

I want to delete one of my custom templates

4

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.

@vindl
Copy link
Member

vindl commented Oct 14, 2020

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.

@jameskoster
Copy link
Contributor

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
1 2

We can explore this more in the relevant issue :)

@vindl
Copy link
Member

vindl commented Oct 14, 2020

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. 😄

@Copons
Copy link
Contributor Author

Copons commented Oct 20, 2020

Related: #26284

@jeyip jeyip added the Needs Design Feedback Needs general design feedback. label Oct 21, 2020
@Copons
Copy link
Contributor Author

Copons commented Nov 20, 2020

@Copons Copons closed this as completed Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Navigation Component A navigational waterfall component for hierarchy of items. Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

No branches or pull requests

4 participants