Template Preview Entry

On this page

Description:

This key represents a template preview entry type for displaying formatted text using a template on Cards in the Collection browser, Structures, and Snippets.

The value is an object that contains a template property with a string value. This displays formatted text using template syntax (e.g., {name}) in card previews.

Appears in:
└── Preview Entry
    └── Template Preview Entry
Type:
Object
Properties:
templatestring Required#

This key defines the template string to use in a template preview entry.

The value is a string that specifies a template with placeholders (e.g., {name}, {date}) that will be replaced with data values when displayed on Cards in the Collection browser, Structures, and Snippets.

Appears in: Template Preview Entry.

Show examplesHide examples

In this example, we have configured the template value to display author and date.

Copied to clipboard
collections_config:
  blog:
    preview:
      text:
        - template: '{author} - {date}'
{
  "collections_config": {
    "blog": {
      "preview": {
        "text": [
          {
            "template": "{author} - {date}"
          }
        ]
      }
    }
  }
}
Examples:

In this example, we have configured a template preview entry to display formatted text.

Copied to clipboard
collections_config:
  blog:
    preview:
      text:
        - template: '{author} - {date}'
{
  "collections_config": {
    "blog": {
      "preview": {
        "text": [
          {
            "template": "{author} - {date}"
          }
        ]
      }
    }
  }
}
Open in a new tab