-
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
Site editor: Add template replace flow to template inspector #54562
Comments
@ntsekouras pinging ya as you worked on the related PR. |
Example: if you wanted to use a different archive template, you can't really — unless your theme does not already have one. For example, my theme here does not have an author archives template, so I can opt to create one, and when I do I am presented with archive template types to choose from. I can't get back to that modal view (which could be populated with template types), to swap for another template, unless I delete the custom author archive template, and then re-add. But you can't delete a theme's templates. |
Resurfacing the pattern modal seems like a good way to get this in quickly, and the ellipsis approach could work well 👍 I'm not 100% sure about the "Swap template" label. It's a bit different to the "Swap template" action when page editing, so I don't know that matching is helpful. It's worth noting there's a similar pattern selection modal that appears when page authoring (if the right patterns exist), and we might want to resurface that one too. Could something more generic like "Swap design", "Swap layout", or even "Swap pattern" work? |
“Replace template”? |
Yeah that can work. It's consistent with "Replace template part" which is a similar flow. |
+1 for "Replace template" |
I made a start on this here: #54609 If anyone else wants to work on it be my guest... |
How is this achieved at present? |
Oh I found it, you add:
to a template... |
I think ellipsis menu is super hidden. For reference, this is the design we had been working from for template parts: #44582 |
Twenty Twenty-Four is exploring adding alternate template types for the home, index, single and page templates. While the effort in #51477 brings alternate template selection to pages, templates still do not have this capability.
There's currently not a method for someone to swap a template directly with another templateType.
Current
Template swapping in the site editor, for pages:
Proposed
If there are alternative templateTypes registered for a specific template, then surface the swapping functionality in the template inspector.
It could be in the verticalEllipsis menu (currently only there when customizations are present), or a button on the inspector, below the template's areas:
I lean towards the verticalEllipsis method, as it's more in line with what we have in pages, and doesn't make it too surfaced. Eventually it'd be nice to see previews of the templates in the sidebar, but for a quick addition something like this seems simple enough.
The text was updated successfully, but these errors were encountered: