I've got a checkboxes field displayed on the user profile form. I'm trying to restyle that field to put the description BEFORE the checkboxes. That seems like it should be a simple thing?
So far I've got:
function MYTHEME_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
$form['my_field_id'][LANGUAGE_NONE]['#theme'] = 'checkboxes_description_before_element';
}
function MYTHEME_theme($existing, $type, $theme, $path) {
return array(
'checkboxes_description_before_element' => array(
'render element' => 'element',
'function' => 'theme_checkboxes_description_before_element'
),
);
}
function MYTHEME_checkboxes_description_before_element($variables) {
return "XYZ";
}
The checkboxes field is still stubbornly sitting on the markup generated by theme_checkboxes instead of "XYZ".
I know that the form element is getting the new '#theme' through checking with dpm()
.