Main content begins here

Remove/Delete TinyMCE WYSIWYG Editor From Specific CCK Field in Drupal Node Edit Form

Wednesday, November 14, 2012

Infrequently I need to remove the TinyMCE WYSIWYG Editor from a particular CCK field in a node edit form. There can be complications with this because of various other modules, etc. Using this drupal.org thread I pieced together a solution that works for me for D6. Maybe it'll help you. Create your own module, then add the following code. Tailor it for your particular content type and field.

function MODULENAME_form_alter(&$form, $form_state, $form_id) {
  // target content type is called 'resource' - replace that below with your content type
  if ($form_id == 'resource_node_form') {
    $form['#after_build'][] = 'resource_node_form_after_build';
  }
}

function resource_node_form_after_build($form, &$form_state) {
  // target field name is 'slideshare1' - replace that below with your field
  $form['field_slideshare1'][0]['format']['#access'] = FALSE;
  return $form;
}

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <h2> <br> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
John has always been a pleasure to work with. He has done a great job and has always been an expert! Will continue to work with him any chance possible. Absolutely superb service. I have full intentions of using him in the future. Very knowledgeable and easy to work with! THANK YOU for working so fast on this project for me!
M. T., Owner Crux Creative, LLC
Copyright ©2001-2018 Way Cool Web Design LLC. All Rights Reserved.