By seanberto on
I've gone through the cck form editing handbook info and am hoping there's an easier solution than trying to retheme all my cck add/edit forms. I'd like to have help text display above input fields.
I've gone through the cck form editing handbook info and am hoping there's an easier solution than trying to retheme all my cck add/edit forms. I'd like to have help text display above input fields.
Comments
override theme_form_element
Just override theme_form_element in your theme's template.php. Just move the output of the description to the point you want.
theme_form_element override example.
Thanks to bangpound, I was able to overwrite where description fields display on form elements in my template.php file as show below. Note for my purposes, descriptions should default to appearing above the input field. However, there are a few instances where it does make sense in my application for the descriptions to appear below, so I have an if statement that catches specific form element ids for which drupal's standard layout should be respected.
Oh, and there's also a bit of code in there that checks field titles to see if they end with a question mark. If so, it replaces the colon delimiter after the field title. (I'm too lazy to take it out for this example. ;) )
Sean Larkin
OpenSourcery.com
Sean Larkin
Just for the record - this
Just for the record - this appears to work fine in D6 also. :) Thanks Sean.
There is a slight issue with
There is a slight issue with this in that the formating guidelines appear all messed up with the help above the radio button - and since they all have an individual id based on the field they are being shown on, it is a bit of a minefield... or close to impossible do "en-mass"... is there a possible catch all solution for this problem?
I copied this into my
I copied this into my template.php file and it has no effect. I am using D6. Is there anything else I need to do to make this work?
davedg629, that snippet is
davedg629, that snippet is quite old.
The following (done by modifying http://api.drupal.org/api/function/theme_form_element/6) should work:
Don't forget to substitute your theme name in the function name.
Thanks for the quick reply. I
Thanks for the quick reply.
I tried the snippet you suggested with no success. I copied it into the bottom of my template.php file and changed the function name to acquia_marina_form_element (I'm using the acquia_marina theme). Sorry, I don't know much about doing theme overrides.
EDIT: I didn't know I had to clear the theme cache. I cleared it and it worked, thanks!
Multi-value fields?
The solution works great for regular fields (one single value) but does not work in multi-value fields.
I need it to adjust the position also with these kind of fields.
Any help would be nice!
Thanks in advance,
aleagi
.
Luiz Gustavo Aleagi Nunes `°º¤ø,¸¸,
http://aleagi.com | http://eopen.com.br
Desenvolvedor Drupal | Padrões W3C | Acessibilidade
¸,ø¤º°`°º¤ø,¸¸,ø¤º°` Nosce te ipsum...¸,ø¤º°``°º¤ø,¸¸,
Multi Value Fields
Hello,
Did you manage to find a solution for multi value fields?
Many thanks
Is there a way to isolate it
Is there a way to isolate it to just one content type?
Thanks
James
Somebody has worked out for
Somebody has worked out for Multi Value Fields already?
This code worked for me but
This code worked for me.
Only the thing is that the description for password in "account information" on user/%/edit is above the title but not under the title.
How can I fix this?
I've written a module for
I've written a module for Drupal 7 that offers a solution to this problem:
http://drupal.org/project/label_help
----------------
Customer Support Engineer, Granicus
https://granicus.com