This key defines which key within values[*].value CloudCannon should use to identify the Structure option.
If CloudCannon cannot find this key in a Structure value, it will compare all other key names in the Structure value to find the correct one.
By default, this key is _type.
Appears in
Type
string
Default value
_type
Examples
In this example, we have change the id_key from the default _type to component to match our existing configuration in the content_blocks Array input.
Copied to clipboard
_inputs:
content_blocks:
type: array
options:
structures: _structures.page_components
_structures:
page_components:
id_key: component
values:
- label: Hero Component
value:
component: hero
title:
description:
image_path:
link:
text:
url:
- label: Feature Component
value:
component: feature
image_path:
title:
description:
button:
link:
text:
reversed_layout: false
- label: Video Component
value:
component: video
image_path:
videoUrl:{
"_inputs": {
"content_blocks": {
"type": "array",
"options": null,
"structures": "_structures.page_components"
}
},
"_structures": {
"page_components": {
"id_key": "component",
"values": [
{
"label": "Hero Component",
"value": {
"component": "hero",
"title": null,
"description": null,
"image_path": null,
"link": {
"text": null,
"url": null
}
}
},
{
"label": "Feature Component",
"value": {
"component": "feature",
"image_path": null,
"title": null,
"description": null,
"button": {
"link": null,
"text": null
},
"reversed_layout": false
}
},
{
"label": "Video Component",
"value": {
"component": "video",
"image_path": null,
"videoUrl": null
}
}
]
}
}
}We have configured the Array input content_blocks to use the page_components Structures.
The id_key for page_components is component.
Each option in the values array has the component key with a different value to identify that option.