How to put field descriptions above fields (below labels)

aharown07 - June 23, 2009 - 20:13

Found this http://drupal.org/node/337388 and a few other things here and there, but not how-to.
I'd like to put field descriptions above the fields. Though this also makes great sense from an accessibility standpoint, it is, IMO, also just the logical place for that sort of info to be... especially if you want to give users a paragraph of info pertaining to a field.
This is especially the case for us w/the registration form.

We want to provide some guidance for registrants regarding usernames. As it is, they key something in there and ignore the text below the field and move on.

So how would I go about making descriptions in general print above fields, but most importantly on the regis. form?

I'm new to Drupal but it

tjkoblentz - June 23, 2009 - 23:12

I'm new to Drupal but it seems like you should check out the form.inc file. It seems like what you are looking for might be in theme_textfield($element) within form.inc.

I would recommend you take a look at both of those bold-ed pieces of code:
- form.inc: http://api.drupal.org/api/file/includes/form.inc/6
- theme_textfield(): http://api.drupal.org/api/function/theme_textfield/6

You then will probably want to create a hook function that overrides the teme_textfield() method with [your_theme_name]_textfield() in order to have the textfields (and other form components) generated (rendered) differently.

I hope that helps!
TJ

Thanks

aharown07 - June 26, 2009 - 23:17

A bit over my head (so far) but I may get there eventually.

 
 

Drupal is a registered trademark of Dries Buytaert.