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:
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.
text_key- String or boolean
Controls what key within an object value is used for the display text in the selected values and values available. Defaults to
name. Has no effect unless the available or selected value is an object. If the value is a primitive type, it is used directly.
If set to
false, no text is displayed.
Allows new text values to be created at edit time. Defaults to
false. Has no effect on select inputs.
Provides an empty option alongside the options provided by
values. Defaults to
true. Has no effect on multiselect inputs.
icon_key- String or Boolean
Controls what key within an object value is used for the icon in the select values and the values available. Defaults to
icon. Must match Material Icon name.
If set to
false, no icon is displayed.
Available to Choice and Multichoice inputs.
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 get in touch with support if you wish to update this for your site.
There are currently three sources for populating the options for a select or multiselect input:
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 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.