Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
https://cgit.drupalcode.org/bootstrap/tree/templates/input/form-element....
For some reason if you put description before input you don't get any classes for the div. I'm guessing nobody noticed because it's not possible to put the description before input easily. I do it like this in theme file:
/**
* Implements hook_element_info_alter().
*/
function THEME_element_info_alter(array &$info) {
// @todo: add more fields here.
$info['email']['#description_display'] = 'before';
$info['select']['#description_display'] = 'before';
$info['textarea']['#description_display'] = 'before';
$info['textfield']['#description_display'] = 'before';
}
Comment | File | Size | Author |
---|---|---|---|
#2 | bootstrap-add_description_class_if_its_before_input-3024796-2.patch | 484 bytes | hkirsman |
Screen Shot 2019-01-09 at 17.55.19.png | 106.92 KB | hkirsman |
Comments
Comment #2
hkirsman CreditAttribution: hkirsman commentedPatch included. This will add class attribute with 2 classes. Example:
Comment #4
markhalliwell