Working with a specific static site generator? Customize CloudCannon's documentation to suit your SSG.
Great! We'll show you documentation relevant to . You can change this any time using the dropdown in the navigation bar.
A structure is a predefined, custom template that determines what should populate an array or object input.
This article covers all the keys available for structure configuration. To learn more about structures, read our documentation on creating a structure.
Each key under the key _structures will have the following options:
Defines what key should be used to detect which structure an item is. If this key is not found in the array item, a comparison of key names is used (default _type).
Sets the behavior when editing existing structure values with inputs not present in the structure with remove_extra_inputs set to false. Defaults to false. Has no effect if remove_extra_inputs is true.
If true, non-structure inputs are hidden in the Data Editor.
If false, non-structure inputs are visible in the Data Editor.
Sets the behavior when saving structures with empty inputs. Defaults to false.
Requires that an id_key is configured for this structure, as otherwise removing inputs would impact how structure values are compared.
If true, empty inputs are removed before persisting the structure data to the source file.
If false, empty inputs are persisted in the source file.
Removed inputs are available for editing again provided they are in the matching structure definition. Inputs are considered empty if the value is null, undefined or ''.
Sets the behavior when editing existing structure values with inputs not present in the structure definition. Defaults to false.
If true, non-structure inputs are removed before the editor loads, and subsequently removed from the source file if saved.
If false, non-structure inputs are either hidden or visible in the editor depending on hide_extra_inputs, but still kept in the source file on save.
If any inputs conflict with structure (e.g. an object's title is a string and the structure's title is an object), the structure version takes priority.
Each array item in values will have the following options:
If set to true, this item will be considered the default type for this structure. If the type of a value within a structure cannot be inferred based on its id_key or matching fields, then it will fall back to this item.
If multiple items have default set to true, only the first item will be used.
The preview definition to change how to display structures when choosing a new structure (both in the select and modal styles). This takes priority over preview when choosing a new structure, and does not affect structures added to the Data Editor.
The preview definition to change how to display structures in the Data Editor, and when choosing a new structure (both in the select and modal styles).
All preview options are available here, although only the following options are used in the Data Editor:
The actual value used when items are added after selection
Structures now support the new preview option. Read our migration guide if you are still using the old options: text_key, subtext_key, image_key, preview_image, description, and image_size.