Posted by ibakayoko on February 18, 2014 at 3:11pm
Hello,
Need some help with Field API/Form/Entity API.
Issue: Want the html in the field label to be processed on node view/node edit/ and in drupal views.
I am currently working on a drupal site and facing one blocking issue.
I am posting here to see if i can get some ideas from the community on how i can address the issue.
I have attached some screenshot of what we have implemented.
The HTML added in the field label is not processed on display. the html tag are displayed like the rest of the label.
Content Type node ADD form
Content Type node View
Customer sample questions
Attachment | Size |
---|---|
content-type-node-add-form.png | 293.97 KB |
content-type-node-view.png | 413.57 KB |
customer-questions-original.png | 129.64 KB |
customer-question-3.png | 130.68 KB |
Comments
add long description text after label field
First, you cannot put the markup to field label and the field label has limit of number of character.
Looks like your field will be structure:
[field label | Question 1:]
[#field_prefix | long question text]
You need to use hook_form_alter or hook_form_FORM_ID_alter to proccess node edit form and add a "#field_prefix" element to the form.
For quick solution without any code, try this module Label help and place all the question in the Label help message
we did alter
we did alter https://drupal.org/project/remove_field_label_length_limit to 2048 to be able to add the long label.
Thank you for your input.
We did tried the form alter option but it was not helping on the node view and drupal views.
One of my colleague "sassafrass" suggested this module https://drupal.org/project/markup, i will go with this option.
I am still open to any suggestions.
With the markup, i will have to add a markup field for each field with HTML.
The markup field is displayed on node edit , node view and in drupal views.