Closed (fixed)
Project:
Term Fields
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2009 at 12:07 UTC
Updated:
2 Nov 2011 at 19:00 UTC
I've just installed the Terms Fields module.
I added a new field of type: Multi-row textarea
Problem is, I need to add a wysiwyg on this field so that an admin can add html.
Is this possible???
Please help.
Comments
Comment #1
harcher commentedBasically, I don't see the option "Input format" under this new field when editing a term.
Can I add it?
Comment #2
seb7 commentedThat would be handy to have that ...
Comment #3
seb7 commentedYou just have to add
on line 122 in term_fields.module
so
becomes
Comment #4
copyhold commentedDoes not work if there are more then one textarea field
Comment #5
b-prod commentedComment #6
b-prod commentedWhat is required for such behavior:
- add a checkbox in the field creation form to specify if the format options should be displayed or not
- for textarea fields, add an additional column in database table to store the format
- modify the field rendering to take care of textarea format if any
The second point means large changes in the way to store the fields data. I think it should probably be a separate issue.
You would be involved in such development?
Comment #7
jdln commentedSubscribing
Comment #8
lcampanis commentedI came accross this problem, and no one seems to post the right solution with a nice explanation. So here it goes...
To have a multiple textareas with input formats available for more than one textarea in your module, the input format, when declared, needs to know its parent(s), so it can look for a textarea inside that scope. When you have more than one textarea and need an input format, consider doing the following:
What you need to watch here are the weights. For your input format to appear under the designated textarea, it needs to have the next consecutive weight.
Enjoy!
Comment #9
b-prod commentedActually this is only hack for one-time uses.
What is really necessary would be to create a patch against the dev version to handle formats in the way described in #6.
Otherwise I will not be able to port anything into the term_fields code.
Comment #10
jayboodhun commentedThanks kiela69,
This solution worked for me :)
Jay
Comment #11
liquidcms commentedsadly it seems like filter_form() returns all available (by role) formats and that it is not possible to limit to only specific formats; i think i need to go through returned array and remove the formats i don't need. would be good if this function allowed passing array of formats required.
Comment #12
b-prod commented@liquidcms : Have a look on better_format module, it could probably help you.
Comment #13
liquidcms commentedhow could better formats help? do they have an api that makes this easier?
Comment #14
b-prod commented@liquidcms: There is no API, but extending the code is possible.
I think it could be easy to implement a new mode of your choice for better format. Existing modes are 'node', 'block' and 'comment'.
A simple hook_form alter() on "better_formats_defaults_admin_form" form ID with addition of better_formats_get_role_default_fields('your_format') to the form and a validate and a submit handler could be suffisant.
To get the expected formats for current user you use:
better_formats_get_default_format('your_format'):
Please open a new support request in better format issue queue if you need more help and copy there last 3 comments of this discussion, because here we are supposed to work on term fields issues:)
Comment #15
harcher commented@B-Prod: Seems to me you could implement this with your eyes closed. You should give it a go :)
Comment #16
b-prod commentedThis feature has been added in the 2.x branch, which need now some testing before its first stable release.