Skip navigation

Reuse groups of elements with snippets

2 min read
Download PDF

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.

    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) Add guidelines and limitations for each element.
    7. Click Save changes.
    Example content type snippet with SEO metadata

    A snippet with two elements limited to a specific number of characters.

    You can also edit codenames of your snippets.

    Almost any element can be in a snippet

    When editing snippets, 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. (Optional) Put the snippet in its own content group for a more organized authoring experience.
    5. Click Save changes.
    SEO metadata snippet used in a content type

    The SEO metadata snippet used in its own Web metadata content group.

    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

    When editing content, the content type snippets become invisible to content creators. The red notification you see here means there's an unresolved comment from someone.

    What's next?