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.
These inputs are for values from a fixed or dynamic set of options. Useful for linking across pages, collections and data sets.
Single value select input for values from a set of options.
Select inputs are shown for inputs configured with the type
select, or for input keys matching or ending with the singular form of a data set key (e.g.
my_color for data set
Multiple value select input for values from a set of options.
Multiselect inputs are shown for inputs configured with the type
multiselect, or for input keys matching or ending with a data set key (e.g.
my_colors for data set
Segmented controls input for selecting a single value from a set of options. Functionally equivalent to a Select input.
Choice inputs are shown for inputs configured with the type
Segmented controls input for selecting multiple values from a set of options. Functionally equivalent to a Multiselect input.
Multichoice inputs are shown for inputs configured with the type
Select, Multiselect, Choice and Multichoice input options are configured with
options inside an
Select, Multiselect, Choice and Multichoice inputs have the following options available:
allow_create - Boolean#
Allows new text values to be created at edit time. Defaults to
allow_empty - Boolean#
Provides an empty option alongside the options provided by
values. Defaults to
true. Has no effect on multiselect inputs.
empty_type - string#
Multiselect and multichoice only.
Set how an 'empty' value will be saved. Does not apply to existing empty values. Can be one of the following:
array- an empty value for this input will be stored as
null- an empty value for this input will be stored as a null value. This does not apply to TOML files.
preview - Object#
The preview definition for changing the way selected and available options are displayed. The options available for select-style inputs are:
See the preview options documentation for detailed information on setting this option. Defaults to:
- key: title
- key: name
- key: icon
preview.text - Array, string or boolean#
Controls the main text shown for selected and available options. Has no effect unless the available or selected option is an object.
If the value is a primitive type, it is used directly.
If set to
false, no text is displayed.
preview.icon - Array, string or boolean#
Controls the icon shown for selected and available options. Must match a Material Icon name.
If set to
false, no icon is displayed.
Available to Choice and Multichoice inputs.
values - Array, object or string#
value_key - String or array of strings#
Defines the key used for mapping between saved values and objects in
values. This changes how the input saves selected values to match. Defaults to
['id', 'uuid', 'path', 'title', 'name']. Has no effect unless
values is an array of objects, the key is used instead for objects, and the value itself is used for primitive types.
If set as an array, keys are tried in order, until a non-empty value is found. If no keys are set for a value available, the value available is not included.
If set as a string, this key is used directly. Values available are excluded if they don't have a value for this key.
Sites created before 25 November 2021 have a different default for saving collection items in order to keep existing sites working. Create a new site, or use the Legacy Collections Value Key flag to update this for your site.
There are currently three sources for populating the options for a select or multiselect input:
- Fixed data sets
- Collection items
- Data files
You can populate the available options for a Select, Multiselect, Choice or Multichoice input with a naming convention or set it explicitly with the input configuration
The saved value when an option is chosen in the editor depends on your data set and the
In addition to having
options.values contain values directly as seen above, you can refer to one of the three available sources. Here's how you can refer to a collection called
You can refer to fixed data sets and data files in a similar way by changing the prefix. For example:
Fixed data sets#
Fixed data sets are defined in
_select_data from the configuration cascade. Best suited when providing options that do not change as content is added or removed.
Collection items are files from your defined collections. Best suited when you need to select from pages or other content files created by team members.
Data files are similar to collections, usually a reserved collection for your SSG. Best suited when you need the available options editable by team members.
Processed data file sets must be arrays of strings, or objects. The value saved is either the string for arrays, or the key for objects.
By default, CloudCannon does not read data files during your build. To use this option source, instruct CloudCannon to read it by defining your data.