The ability to copy Content Types was added in version 22.05
, allowing the creation of new Content Types from existing ones.
This means any created Content Type can function similarly to a Base Content Type. This can allow, for example, rapid prototyping of Content Types with variations — a significant time saver with complex Content Types.
Copying a Content Type is also very simple!
Using the Admin Panel
Simply go to the Content Types tool in the main navigation menu, and then click the “hamburger” menu button (three vertical dots) to the right of the Content Type to be copied.
A modal dialog will pop up, prompting you to give your copy a new name. If desired, you can also specify a new icon, a new site or folder selection, or a custom variable name.
Once you click Copy, you will be taken to the Content Type editor, where you'll find the newly minted Content Type copy. Now you can begin to make any desired modifications to it, or simply exit if no changes are needed.
Your new Content Type will appear immediately on the Content Type menu.
Headless Content Type Duplication
Copying a Content Type can also be performed with the Content Type API. It requires little more than an HTTP POST
call to the following endpoint:
{HOST}/api/v1/contenttype/{CONTENT_TYPE_VAR}/_copy
This call must include as its body a JSON object with the following properties:
Property | Required? |
---|---|
name | Yes |
variable | No |
folder | No |
host | No |
icon | No |
The enclosed data can be as simple as:
{
"name": "Content Type Copy"
}
For more detail, see the appropriate section of Content Type API document.