I had Drupal 5.x with the TinyMCE module installed. If a page's input format was set to 'PHP code', the editor did not appear (which is good). When I upgraded to Drupal 6, the editor appears on body textarea's even if it's set to 'PHP code'.

How do I disable TinyMCE for a specific input format?

Comments

marcvangend’s picture

If I'm not mistaken, that is a feature of the wysiwyg module.

rgraves’s picture

I haven't moved to the wysiwyg module yet since I have enough headaches with the upgrade to Drupal 6. I know the editor didn't appear in Drupal 5, but I don't recall how I disabled it then.

marcvangend’s picture

I have never had problems with the wysiwyg module, but if you don't want to install it (yet), I'm afraid I don't know the solution for you.

rgraves’s picture

I figured out a way that works, but if anyone knows a better method, let me know.

In my template.php file, I have a function called themename_tinymce_theme which I used to ensure TinyMCE only appears on the BODY textareas and not others.

I added code to ensure it did not appear if the format type was 2 (PHP code):

  switch ($textarea_name) {
    // Enable tinymce for these textareas
    case 'body':
      // Disable tinymce if the input format is PHP code
      $node = node_load(arg(1));
      if ($node->format == 2) {
        unset($init);
      }
     break;
   // Disable tinymce for all other textareas
   default:
      unset($init);
  }

I didn't need this for Drupal 5 so I know there must be another way to accomplish this, but this method works too.