By default, Bootstrap will render the input
radio and checkbox elements as children of the label
. This is done in Drupal\bootstrap\Plugin\Preprocess\FormElement
, starting at line 45:
// Place single checkboxes and radios in the label field.
if (($checkbox || $radio)) {
$label = Element::create($variables['label']);
$children = &$label->getProperty('children', '');
In some instances, I don't want these printed as siblings - how can I undo this? form-element.html.twig
isn't helpful unless I can somehow print the children first e.g. {{ label.#children }}
and then twig will know not to print them again. Not sure if that solution is even possible.
Thanks!