Copying a Content Type

Last Updated: Nov 10, 2022
documentation for the dotCMS Content Management System

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

A screenshot of the content type screen with the item menu open to the Copy selection.

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 closeup of the Copy selection on the Content Type menu.

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.

The Copy Content Type modal dialog.

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.

The Content Type menu with the newly copied Content Type at the top.

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:

PropertyRequired?
nameYes
variableNo
folderNo
hostNo
iconNo

The enclosed data can be as simple as:

{
    "name": "Content Type Copy"
}

For more detail, see the appropriate section of Content Type API document.

On this page

×

We Dig Feedback

Selected excerpt:

×