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 

Name Type Default Required
string|int ''
array true
boolean false
object
object
object
object
string
object
boolean false

default

default
Type
string|int
Default
''

Default value set if a new record is created.

items

items
Type
array
Required

true

Contains the radio items. Each item is an array with the keys label and value. 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

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 itemsProcConfig is allowed.

behaviour.allowLanguageSynchronization

behaviour.allowLanguageSynchronization
Type
boolean
Default
false

Allows to select if localization uses custom or default language value.

fieldControl

fieldControl
Type
object

fieldInformation

fieldInformation
Type
object

fieldWizard

fieldWizard
Type
object

itemsProcessors

itemsProcessors
Type
object

A list of PHP classes called to fill or manipulate the items array. Each entry is keyed by a numeric index and requires a class property. An optional parameters object can be passed to the processor.

Example:

itemsProcessors:
  0:
    class: 'Vendor\Extension\ItemsProcessor\MyProcessor'
    parameters:
      foo: bar
Copied!

itemsProcFunc

itemsProcFunc
Type
string

Deprecated since version 2.3.0

Use itemsProcessors instead.

PHP method which is called to fill or manipulate the items array. See TCA itemsProcFunc.

itemsProcConfig

itemsProcConfig
Type
object

Additional configuration passed to itemsProcFunc. Must be listed in allowedCustomProperties (included by default).

readOnly

readOnly
Type
boolean
Default
false

Renders the field in a way that the user can see the value but cannot edit it.

Example 

Minimal 

name: example/radio
fields:
  - identifier: radioboxes
    type: Radio
    items:
      - label: 'First option'
        value: 0
      - label: 'Second option'
        value: 1
Copied!

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'
Copied!