Skip navigation

Reuse groups of elements with snippets

Content type snippets are reusable groups of content elements. You'll use snippets when modeling content.

If you ever need to use the same elements repeatedly in a few content types, you can create a snippet to hold those elements. With this approach, you can easily modify the elements from one place. Content contributors won't see the snippets while editing content.

Table of contents

    Create a content type snippet

    Let's look at an example of using a snippet for SEO metadata.

    To create a content type snippet for SEO metadata:

    1. In Content model, select the Content type snippets tab.
    2. Click Create new.
    3. Type a name in Content type snippet name.
    4. Insert two Text elements into the elements area.
    5. Name the elements Meta keywords and Meta description.
    6. (Optional) Provide guidelines and limitations for each element.
    7. Click Save changes.
    Example content type snippet with SEO metadata

    You can also edit codenames of your snippets.

    Almost any element can be in a snippet

    When defining a snippet, you can use all content elements except for the content type snippet and URL slug elements.

    Add a snippet to content types

    After you create a content type snippet, use it in a content type. To prevent duplicate elements, you can't use one snippet multiple times in the same content type.

    1. In Content model, open an existing content type.
    2. Insert the Content type snippet element into the content type.
    3. Choose a snippet from the drop-down list.
    4. Click Save changes.
    SEO metadata snippet used in a content type

    Snippets in content items

    In content items, the content type snippets are replaced by the elements they contain.

    SEO metadata snippet as seen in a content item

    What's next?