WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.41k stars 4.16k forks source link

Site Editor: add option to duplicate custom template to three dot menu #36665

Open paaljoachim opened 2 years ago

paaljoachim commented 2 years ago

The following is based on testing the PR Gutenberg Build from this PR: https://github.com/WordPress/gutenberg/pull/36379#issuecomment-973432382

What problem does this address?

It would be helpful to add a duplicate template into the 3 dot menu.

Screenshot 2021-11-19 at 16 40 19

What is your proposed solution?

Adding a duplicate option. Duplicate-template

jameskoster commented 2 years ago

It's important to note that only custom templates can be duplicated. It should not be possible to duplicate primary templates (index, single, archive, search, etc).

Mamaduka commented 2 years ago

@jameskoster user should be able to duplicate, let's say single.html and use it as a base for Page. But this would require extra steps.

We can start with custom templates and progressively enhance the duplication feature.

jameskoster commented 2 years ago

We need to be careful with providing a duplication UI for primary templates because in this case duplication should only occur as part of the new template creation flow, never as a discrete action. We shouldn't make it possible for folks to create multiple index templates for instance. Perhaps the duplication element doesn't need to be surfaced to the user at all..?

user should be able to duplicate, let's say single.html and use it as a base for Page. But this would require extra steps.

For that particular example I think the flow should focus around adding a "Page" template from the "Add new" menu, and the duplication of single should take place automatically in the background.

paaljoachim commented 2 years ago

Let's go with:

We can start with custom templates and progressively enhance the duplication feature.

aurooba commented 2 years ago

Hallo! I agree that it makes sense to start with custom templates. :) This was a little mockup I made a couple days ago in a duplicate issue:

kebab menu for templates has a duplicate option

The idea I had is that clicking on the duplicate option, pops open the same dialog we get now when we make a new template, letting us choose a name and the template the customizations should be assigned to.

porg commented 1 year ago

Core functions of any template/preset management in any software:

Looked for the "duplicate" functionality in the more dropdown of the template name that I wanted to duplicate, exactly as proposed!

annezazu commented 4 weeks ago

Here's the current experience as of 6.6.1 with GB 19.1 installed. Right now, we have the option to duplicate with pages, template part, and patterns but not with templates due to this work https://github.com/WordPress/gutenberg/pull/63032 This led to larger questions around duplicating in general: https://github.com/WordPress/gutenberg/issues/61083

https://github.com/user-attachments/assets/b3b02df0-a2ce-4627-be84-f04778d73e0a

Duplicating templates, as noted above, should start with custom templates only before figuring out a proper UX.

jameskoster commented 3 weeks ago

Agreed, let's start with duplicating custom templates.