This is a small extension for Contao to display radio buttons with images.
- Contao 5.0+
- PHP 8.1+
$ composer require guave/visualradio-bundleAdd the visual radio as a field. Required are the following:
- the templates as an array for options (without
ce_) eval['imagePath']is a path within your webrooteval['imageExt']is the file extension of your images
$GLOBALS['TL_DCA']['tl_content']['fields']['visualradio'] = [
'inputType' => 'visualradio',
'options' => [
'2col-text',
'1col-img'
],
'eval' => [
'imagePath' => 'files/content-elements/images',
'imageExt' => '.jpg',
],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];