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

metadata

Table of contents

Description:

This key defines metadata entries displayed on Cards in the Collection browser, Structures, and Snippets.

The value is an array of metadata entry objects. Each metadata entry can contain text, image, icon, icon_color, and icon_background_color properties.

Metadata entries are typically used to display additional information about a card, such as publication dates, URLs, or other contextual data.

Appears in:
├── preview
│   └── metadata
└── picker_preview
    └── metadata
Type:
Array<metadata[*]>
Items:
[*]Object#

This key represents an individual metadata entry object in the preview.metadata array.

The value is an object that can contain text, image, icon, icon_color, and icon_background_color properties. Each metadata entry is displayed on Cards in the Collection browser, Structures, and Snippets.

Show examplesHide examples

In this example, we have configured a metadata entry for Cards in the blog Collection to display the URL using a template.

Copied to clipboard
collections_config:
  blog:
    preview:
      metadata:
        - template: '[url]'
{
  "collections_config": {
    "blog": {
      "preview": {
        "metadata": [
          {
            "template": "[url]"
          }
        ]
      }
    }
  }
}
Examples:

In this example, we have configured two metadata entries for Cards in the blog Collection to display the URL and publication date.

Copied to clipboard
collections_config:
  blog:
    preview:
      metadata:
        - text:
            - key: url
        - icon: event
          icon_color: light-blue
          text:
            - template: Published on {date|date_long}
{
  "collections_config": {
    "blog": {
      "preview": {
        "metadata": [
          {
            "text": [
              {
                "key": "url"
              }
            ]
          },
          {
            "icon": "event",
            "icon_color": "light-blue",
            "text": [
              {
                "template": "Published on {date|date_long}"
              }
            ]
          }
        ]
      }
    }
  }
}
Open in a new tab