Overview
The radio fieldtype is a multiple choice input where you only get one choice. It saves the chosen option from a preset list.
Configuring
Use the options
setting to define a list of values and labels.
favorite: type: radio instructions: Choose your favorite food. options: donuts: Donuts icecream: Ice Cream brownies: Brownies
You may omit the labels and just specify keys. If you use this syntax, the value and label will be identical.
options: - Donuts - Ice Cream - Brownies
Data Structure
The chosen option is stored as a string. If you only specified values for the options
array, then the label will be saved.
favorite: brownies
Templating
It's a string, so you can just use that value.
<p>I love {{ favorite }}. A lot.</p>
<p>I love {{ $favorite }}. A lot.</p>
<p>I love donuts. A lot.</p>
Options
inline
Show the radio buttons next to each other in a row instead of stacked vertically. Default: false
options
Sets of key/value pairs define the values and labels of the radio options.