contao/core — Issue #3870: Request re Backend multiple checkbox grouping with labels
Author: rogerramjet
Created: 2012-01-29 05:26:34+00:00
State: open

Please see this image as an example. http://contao11.vidweb.org/temp.html

This is the desired effect I would like to get (where "testbreak" is a label for a checkbox group).
This was done by adding a string to the end of a checkbox label in the options_callback, so that there is a break and a label before the next checkbox.

$arrCheckboxes['country'] = $GLOBALS['TL_LANG']['tl_housesella']['country'][0] . '
Testbreak';

$arrCheckboxes['nextcheckbox'] = $GLOBALS['TL_LANG']['tl_housesella']['nextcheckbox'][0];

However I need a way to add the string before the actual checkbox, as the previous one might not be present (so neither will the break and label)

The only way I can think of is if $this->generateCheckbox?? recognizes a certain array key, and prints the code around the Global or string value

$arrCheckboxes['LABEL'] = 'Testbreak';
A problem is the keys need to be unique, so really the routine would need to look for and parse a unique identifier like LABEL_

$arrCheckboxes['LABEL_1'] = 'Testbreak One';
$arrCheckboxes['LABEL_2'] = 'Testbreak' Two;

Anyhoo, there probably a better way, but I think this would be better UX for selecting multiple checkboxes if they could be grouped by label (Address Details, Personal Details etc) within a multiple checkbox input.

Food for thought.