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.
I put the code below that I happened to find on another site to template.php in garland theme but it doesn't work.
Anybody has successfully moved the help texts after(below) labels?
function garland_form_element($element, $value) {
$output = '<div class="form-item"';
if (!empty($element['#id'])) {
$output .= ' id="'. $element['#id'] .'-wrapper"';
}
$output .= ">n";
$required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : '';
if (!empty($element['#title'])) {
$title = $element['#title'];
if (!empty($element['#id'])) {
$output .= ' <label for="'. $element['#id'] .'">'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>n";
}
else {
$output .= ' <label>'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>n";
}
}
if (!empty($element['#description'])) {
$output .= ' <div class="description">'. $element['#description'] ."</div>n";
}
$output .= " $valuen";
$output .= "</div>n";
return $output;
}
Comments
Comment #1
DonnyCarette CreditAttribution: DonnyCarette commentedTry the following code and clear your cache after adding this to your template.php
(If you are using another theme, change 'garland' to your theme name in the function
Comment #2
chinita7 CreditAttribution: chinita7 commentedI just tried it and worked. Thanks!
Comment #3
zeta1600 CreditAttribution: zeta1600 commentedHow about for D7?