Duplicate a content type
s
ssoftwares
In my project there are many api's which have pretty much similar fields except one or two, it would be great if we have a feature to duplicate a content type fields in one click then add or remove the difference and finally create a new content type.
K
Kristjan
Requesting a way to duplicate/copy a content type in admin UI Content-Type builder or some other way (like requested here https://github.com/strapi/strapi/issues/12518).
Would like to copy a single-type with all its fields and alter the content type's Display name, API Id, API Id plural before saving it.
Please upvote this issue.
Warden
there is plugin:
b
bill
Warden: this plugin claims to add a duplicate button to the content edit view. But it doesn't seem to work for me (strapi v4.6.1)
we really need a way to clone content-types
Warden
bill: what you mean it doesn't work? I using it right now, and i can copy any entry in collection type. do you have button "Duplicate" on side panel?
b
bill
Warden: Hi. I don't see the button. how did you install it? I ran the yarn install and added "'duplicate-button': true" to config/plugins.js. And I see the Duplicate Button plugin the list of installed plugins.
Aside from that, what I think people are looking for in this thread is not duplicating content, but duplicating/cloning content-types (eg collection types)
Warden
bill: duplicating/cloning collection types can only be done in development, and its manual process. As for copy content a you can only do it one at tim,e at moment i think.
try like this:
'duplicate-button': {
enabled: true,
}
or you can just make your own plugin and copy code, thats how I did it.
b
bill
Warden: actually, I figured it out. you have to run
strapi build
after yarn/npm installing the plugin
b
bill
Also, there is already a built-in feature to duplicate content. in the content list for a given collection-type, each row has a duplicate button next to the edit/delete buttons
Warden
bill: i know, this just adds button inside entry, but function is the same
K
Kristjan
Warden: This plugin is not for duplicating content-types (for example single-type in Content-Type builder) but for duplicating content, right?
Simo Moujami
This is especially relevant if you decided to rename a content-type. And because the api name and plural fields become non-editable post creation, it's a pain to have to redefine 20+ fields, some of which are enums and have constraints and such.