Create a template

How to create a template

To create a template:

  1. Log in to the Contentful web app.

  2. Click the environment switcher.

    Environment swithcer
  3. Click the organization name, and select Organization settings & subscriptions.

  4. Navigate to the "Model templates" tab. The Content model templates overview page is displayed.

    Content model templates: template editor
  5. Click +Create content model template. The “Name your content model template” modal is displayed.

    Content model templates: Name your content model template modal
  6. Give the template a descriptive name to help others locate it easily later. 

  7. Optional: Add a description based on its purpose.

  8. Click Create template. The template editor is displayed.

    Content model templates: Editor tab
  9. On the “Content types” tab, choose the Space and Environment from where you want to add content types to your template.

  10. After selecting the space and environment, the content types available in the chosen options are displayed. You can select each content type individually, or click Add all.

    Content model templates: Add all

    NOTE: You can also search for a specific content type using the search bar.

  11. There are three kinds of content types, each with a different behavior:

    1. Content type with no reference fields. They will move straight into the template. 

    2. Content type with a reference field(s) with no validations set. Remember to add all content types that are needed for referencing.

    3. Content type with a reference field(s) with validations, which will open a reference tree modal.

  12. When selecting a content type that has a reference field(s) with validations, a reference tree modal is displayed. This modal shows all referenced content types and their references.

    Select the content types you want to also add to the template.

    Content model templates: "Add referenced content types" modal

    NOTE: The valid content types are all pre-selected by default, and clicking Add to template will add them all.

  13. Once you are done adding your content types, you can double-check if you added the correct ones in the “Content model template” tab.

    Content model templates: "Content model template" tab
  14. If everything looks good, click Create template. The "Save Version" modal is displayed.

    Content model templates: Save version
  15. In the Version name field, enter a relevant name for the template version.

  16. Optional: Add a description. A suggestive description also helps other users in your organization know what exactly this template version contains, or how it might have changed from the previous version.

  17. Click Save. This will create a snapshot of the template.

    The template version is saved and displayed on the "Versions" tab, where you can view the complete list of template versions.

    Content model templates: Version created

    From here you can install the template into your spaces and environments, edit the details, or view the content types stored in the specific version.

Next steps