Radio
The Radio
type creates a set of radio buttons. The value is typically
stored as integer value, each radio item has one assigned number, but it can be
a string, too.
Settings
default
-
- Type
- string|int
- Default
- ''
Default value set if a new record is created.
items
-
- Type
- array
- Required
true
Contains the radio items. Each item is an array with the keys
label
andvalue
. Values are usually integers, but can also be strings if desired.Example:
items: - label: 'First option' value: 0 - label: 'Second option' value: 1 - label: 'Third option' value: 2
Copied!XLF translation keys for items have the following convention:
<body> <trans-unit id="FIELD_IDENTIFIER.items.1.label"> <source>Label for item with value 1</source> </trans-unit> <trans-unit id="FIELD_IDENTIFIER.items.2.label"> <source>Label for item with value 2</source> </trans-unit> <trans-unit id="FIELD_IDENTIFIER.items.VALUE.label"> <source>Label for item with value VALUE</source> </trans-unit> <trans-unit id="FIELD_IDENTIFIER.items.label"> <source>Label for item with empty value</source> </trans-unit> </body>
Copied!
allowedCustomProperties
-
- required
-
false
- type
-
array
- default
-
["itemsProcConfig"]
Sometimes it is needed to provide custom configuration for the itemsProcFunc functionality. These extra properties need to be explicitly allowed via this option. This option receives an array of those strings. By default, the custom option
items
is allowed.Proc Config
Example
Minimal
name: example/radio
fields:
- identifier: radioboxes
type: Radio
items:
- label: 'First option'
value: 0
- label: 'Second option'
value: 1
Advanced / use case
name: example/radio
fields:
- identifier: radioboxes
type: Radio
default: 'one'
items:
- label: 'First option'
value: 'one'
- label: 'Second option'
value: 'two'
- label: 'Third option'
value: 'three'