- Description:
This key defines the icon displayed on Cards in the Collection browser, Structures, and Snippets.
The value can be an array or a single value, and reference a key, template, text string, that results in one of Google's Material Symbols. When multiple entries are provided, CloudCannon will use them in order as fallback options.
For Cards in the Collection Browser, this key defaults to the value of
collections_config.*.icon. Otherwise, this key has no default.- Appears in:
- Types:
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
falsevalues. Each preview entry object can contain akey,template, ortextproperty. When multiple entries are provided, CloudCannon will use them in order as fallback options.Show examplesHide 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
titlefirst, then the{name}template, and finally fall back to the static text value.Copied to clipboardcollections_config: blog: preview: text: - key: title - template: '{name}' - text: Untitled{ "collections_config": { "blog": { "preview": { "text": [ { "key": "title" }, { "template": "{name}" }, { "text": "Untitled" } ] } } } }This key represents a raw text preview entry type for displaying static text on Cards in the Collection browser, Structures, and Snippets.
The value is a string that specifies static text to display in card previews. This is equivalent to using
{ text: "..." }but in a simpler format.Show examplesHide examples
In this example, we have configured a raw text preview entry to display static text.
Copied to clipboardcollections_config: blog: preview: text: Untitled{ "collections_config": { "blog": { "preview": { "text": "Untitled" } } } }This key represents a preview entry that disables the preview display for a specific field on Cards in the Collection browser, Structures, and Snippets.
The value must be
false. Setting a preview entry tofalsewill hide that preview element.Show examplesHide examples
In this example, we have configured the preview text to be disabled.
Copied to clipboardcollections_config: blog: preview: text: false{ "collections_config": { "blog": { "preview": { "text": false } } } }- Examples:
In this example, we have configured the icon for Cards in the
blogCollection to use theedit_noteicon.Copied to clipboardcollections_config: blog: preview: icon: edit_note{ "collections_config": { "blog": { "preview": { "icon": "edit_note" } } } }In this example, we have configured the icon for Cards in the
blogCollection with an array of values to provide fallback options. CloudCannon will use the value oflogofirst, then fall back to theedit_noteicon.Copied to clipboardcollections_config: blog: preview: icon: - key: logo - edit_note{ "collections_config": { "blog": { "preview": { "icon": [ { "key": "logo" }, "edit_note" ] } } } }