☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

Array Preview Entry

Table of contents

Description:

This key represents an array of preview entries for displaying data on Cards in the Collection browser, Structures, and Snippets.

The value is an array of preview entry objects, strings, or false values. Each preview entry object can contain a key, template, or text property. When multiple entries are provided, CloudCannon will use them in order as fallback options.

Appears in:
├── _inputs
│   └── *
│       └── Text Input
│           └── options
│               ├── icon_color
│               │   └── Array Preview Entry
│               └── icon_background_color
│                   └── Array Preview Entry
├── text
│   └── Array Preview Entry
├── subtext
│   └── Array Preview Entry
├── image
│   └── Array Preview Entry
├── icon
│   └── Array Preview Entry
├── icon_color
│   └── Array Preview Entry
├── icon_background_color
│   └── Array Preview Entry
└── background_color
    └── Array Preview Entry
Type:
Array<Preview Entry>
Items:
preview-entryKey Preview Entry|Template Preview Entry|Text Preview Entry|Raw Text Preview Entry|False Preview Entry#

This key defines a preview entry configuration for displaying data on Cards in the Collection browser, Structures, and Snippets.

The value can be an object with a key, template, or text property, a raw text string, false, or an array of these values. When multiple entries are provided, CloudCannon will use them in order as fallback options. Preview entries are used to configure how data is displayed in card previews.

Show examplesHide examples

In this example, we have configured a preview entry with an array of values to provide fallback options. CloudCannon will use the value of title first, then the {name} template, and finally fall back to the static text value.

Copied to clipboard
collections_config:
  blog:
    preview:
      text:
        - key: title
        - template: '{name}'
        - text: Untitled
{
  "collections_config": {
    "blog": {
      "preview": {
        "text": [
          {
            "key": "title"
          },
          {
            "template": "{name}"
          },
          {
            "text": "Untitled"
          }
        ]
      }
    }
  }
}

In this example, we have configured a preview entry to display the title key.

Copied to clipboard
collections_config:
  blog:
    preview:
      text:
        - key: title
{
  "collections_config": {
    "blog": {
      "preview": {
        "text": [
          {
            "key": "title"
          }
        ]
      }
    }
  }
}
Examples:

In this example, we have configured an array of preview entries with an array of values to provide fallback options. CloudCannon will use the value of title first, then the {name} template, and finally fall back to the static text value.

Copied to clipboard
collections_config:
  blog:
    preview:
      text:
        - key: title
        - template: '{name}'
        - text: Untitled
{
  "collections_config": {
    "blog": {
      "preview": {
        "text": [
          {
            "key": "title"
          },
          {
            "template": "{name}"
          },
          {
            "text": "Untitled"
          }
        ]
      }
    }
  }
}
Open in a new tab