4

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

1

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.

-2

I always use Wysiwyg module with the following steps:

  1. Install wysiwyg module
  2. Download TinyMce library to libraries (sites/add/libraries) folder
  3. Create a new input format, called Wysiwyg (admin/config/content/formats)
  4. Set the correct roles to this input format
  5. Set this as a full html format (don't convert line breaks to brs etc)
  6. 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 am using tinymce within WYSIWYG module already – user7282 Mar 20 '13 at 9:30
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.