I am using WYSIWYG module with TinyMce as Rich Text Editor. I need to make the rich text editor disabled only for a particular text area in a create content page, i.e., when I click Enable rich-text link, it must get activated. How can this be done?I am using drupal 6
There's a solution here http://www.only10types.com/2011/12/drupal-6-enabledisable-wysiwyg-editor.html
Basically, you need to alter this specific edit form. This is what I did for Drupal 7 (the blog post is for Drupal 6):
function MYMODULE_form_alter(&$form, &$form_state, $form_id) {
// Workaround to disable Wysiwyg just in this field.
if ($form_id === 'FORM_ID_OF_EDIT_FORM') {
$form['field_CUSTOM'][LANGUAGE_NONE][0]['#wysiwyg'] = FALSE;
}
}
You may want to use $language->language instead of LANGUAGE_NONE.
I always use Wysiwyg module with the following steps:
- Install wysiwyg module
- Download TinyMce library to libraries (sites/add/libraries) folder
- Create a new input format, called Wysiwyg (admin/config/content/formats)
- Set the correct roles to this input format
- Set this as a full html format (don't convert line breaks to brs etc)
- Connect wysiwyg profile to this (admin/config/content/wysiwyg)
This solution is for Drupal 7 but you can do it on D6 too with the same steps, just change the administration urls.
-
-
I'm sorry, I was careless. So you want to disable it only on a specific form element? – hosszu.kalman Mar 20 '13 at 9:40
-
yes, I need to disable it by default only for a text area of one content type only – user7282 Mar 20 '13 at 9:41
-
Did you try better formats module? Maybe it can help you but I'm not sure – hosszu.kalman Mar 20 '13 at 9:50