Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Rumblewand's answer, with a conditional that prevents radio/checkboxes from also being thrown into a div above the input. (May be more efficient ways to do this.)</p> <pre><code> function theme_form_element($variables) { $element = $variables['element']; $value = $variables['element']['#children']; $wrapper_classes = array( 'form-item' ); $output = '&lt;div class="' . implode(' ', $wrapper_classes) . '" id="' . $element['#id'] . '-wrapper"&gt;' . "\n"; $required = !empty($element['#required']) ? '&lt;span class="form-required" title="' . t('This field is required.') . '"&gt;*&lt;/span&gt;' : ''; //Separate treatment for radio buttons &amp; checkboxes if (($element['#type'] == 'radio') || ($element['#type'] == 'checkbox')) { //vs outputting input in its own div separate from label $output .= $value . "\n"; if (!empty($element['#description'])) { $output .= '&lt;span class="description"&gt;' . $element['#description'] . "&lt;/span&gt;\n"; } if (!empty($element['#title'])) { $title = $element['#title']; $output .= '&lt;label class="option" for="' . $element['#id'] . '"&gt;' . t('!title !required', array('!title' =&gt; filter_xss_admin($title), '!required' =&gt; $required)) . "&lt;/label&gt;\n"; } } else { if (!empty($element['#title'])) { $title = $element['#title']; $output .= ' &lt;label for="' . $element['#id'] . '"&gt;' . t('!title !required', array('!title' =&gt; filter_xss_admin($title), '!required' =&gt; $required)) . "&lt;/label&gt;\n"; } if (!empty($element['#description'])) { $output .= '&lt;div class="description"&gt;' . $element['#description'] . "&lt;/div&gt;\n"; } $output .= '&lt;div id="' . $element['#id'] . '"&gt;' . $value . '&lt;/div&gt;' . "\n"; } $output .= "&lt;/div&gt;\n"; return $output; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload