guave/visualradio-bundle

Visual Radio Field for Contao 4.13+

Installs: 1 357

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 1

Type:contao-bundle

2.3.0 2024-03-28 20:23 UTC

This package is auto-updated.

Last update: 2024-04-11 08:33:12 UTC


README

This is a small extension for Contao to display radio buttons with images.

Requirements

  • Contao 4.13+
  • PHP 7.4 or 8.0+

Install

$ composer require guave/visualradio-bundle

Usage

Add 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 webroot
  • eval['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' => ''],
];