How you configure inputs in CloudCannon has changed. We recommend updating, but the previous configuration will continue to work. There's now a consolidated key called _inputs that encompasses our previous keys:
_options
_comments
_instance_values
_select_data
_structures (renamed from _array_structures)
Having the configuration keys at the top level forced you to redefine your input key multiple times, and spread the configuration for an input across multiple places. This proved to be progressively harder to maintain as you configured more inputs.
We've also introduced two new configuration settings, type and label. These let you choose which kind of input you want, and what label text is shown separately from the naming conventions.
You can now choose the select values (separately from the naming convention) for a select or multiselect input with values. Either define the values directly:
Array Structures are now called Structures, and configured with _structures instead of _array_structures. Outside of this rename, there are no changes to the configuration itself:
Input configuration
copied
Input configuration
copied
Input configuration
copied
You can now choose the structures (separately from the naming convention) for an array input with structures. Either define the values directly:
The _inputs configuration is set alongside the inputs in the examples above. You can set it anywhere in the configuration cascade, just as the previous keys allowed. The keys inside _inputs entries are merged across the cascade, allowing you to overwrite or combine more specific configurations (e.g. setting comments globally and options per file).
_select_data and _structures are defined in the configuration cascade as well, so you can set them with or separately to _inputs.
Color inputs have new format and alpha options, falling back to the naming convention if these options are not set.
Hiding inputs is now set with hidden in an _inputs entry rather than an option, since it's available for any input type. This key also supports a string where the input is hidden based on the value of another input. This can start with a ! to reverse the value.
Object structures are now supported. These allow you to configure objects between an empty state (null) and a selection of object formats. Useful if you have components with a limited number of sub-components.
Two new inputs: Range number input and a Switch boolean input. These are only available with the new inputs config. More input types coming soon, contact support if you have specific requests.
Comments now support a limited set of Markdown: links, bold, italic, subscript, superscript and inline code elements are allowed. Links in this block also support Editor Links.