For some background, take a look at #314385: Make position of #description configurable via the API. In a nutshell, descriptions of form fields normally always appear below their respective fields. Users of my site found this confusing, especially in cases where the description is necessary to know how to fill out the field. After some research, it seems that the most intuitive solution is to place the description above the field and below the title / label, if it exists. If there is no title (the field options themselves act as a title), then the description stays below the field.

This may not interest everyone, but I thought I'd at least share how to make it possible. If there is enough interest I think it should be included in releases, at least as an option.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dane Powell’s picture

Sorry, I just realized that I may have not generated that patchfile relative to the right directory, but really a patch is overkill here anyway - you can just copy the applicable code and paste it at the end of template.php.

Jeff Burnz’s picture

My major concern with messing with theme_form_element is the plethora of modules I don't have time to test against, even CCK and Views need testing and my time is very limited.

If someone wants to use it I think its a nice solution, but for now I have more pressing matters to attend to, such as porting this theme to a more flexible base theme.

EyeChartBrew’s picture

FWIW, this worked very well for my site. Thanks!
//TB

Dane Powell’s picture

Status: Active » Postponed

Fair enough - for what it's worth, I have been using this since I submitted it and have had no problems. I believe I took the code from the definition of theme_form_element and added some bare-bones logic, so I don't know how it would break anything. Anyway, we can call this postponed for now until you're more comfortable with it and leave it an option for other users, or you can mark it won't fix if you want...

adraskoy’s picture

Worked well once I realized that "_reloaded" was part of part of the theme name and took that out. Really it is so much more intuitive to place the descriptions this way that it should really be the default, and placing them after should be a special case. At the very least, this should go into the FAQs for the module. It took me some time and determination to find this via searches. Thanks!

Jeff Burnz’s picture

It could be optional in a theme setting, or the other way around. This is a big improvement, no doubt, especially for accessibility. I believe this is going to change in D7 (I recall seeing an issue about this).

I want to try it out, and test with a wide range of modules first - my big concern is other modules that might also implement theme_form_element, will need to do some testing.

mautumn’s picture

Thanks for this patch. I believe this is a much better UE (User Experience). The description qualifies or adds more detail to the question/form label, and it just strikes me as common sense, more intuitive to put this directly below the question/form label.

The reductio ad absurdum of the current default - of putting the description below the field/s - is where the list of options or size of the field is more than will fit in the available displayed form space: the user will not even see the description before filling in that part on the form...

It would be great if there was a global site preference for this, with the default of having the description directly under the label/title and above the field/s, as stated in this issue.

Dane Powell’s picture

Since Jeff is so busy, does anyone else have time to test this or offer any thoughts? It sounds like quite a few people are using it without problem.