Drupal 5 - Disable FCKEditor per content type

Anyone using the Drupal module for FCKEditor can tell you the number of times its made their life easier. Install and configure it and you have yourself an instant (and FREE) WYSIWYG HTML Editor.

I mentioned in my previous posts, I am currently working on making Drupal Forums look and function like PHPBB. Having installed the superb Smileys Module by Gurpartap Singh I noticed FCKEditor was breaking the Smilie insertion on the nodepages.

To solve the problem, I wanted my Drupal 5 "Forum" content type to not display FCKEditor formatter. It seems Drupal 6 version of FCKEditor already has restrict by content type setting but Drupal 5 version no such feature. A quick chat with my friend and colleage Nick Thompson and stumbling upon this tip in drupal forums

I ended up doing a hook_form_alter like this:

<?php
function mymodule_form_alter($form_id, &$form) {
  if (
$form_id == 'forum_node_form') {
   
$form['body_filter']['body']['#wysiwyg'] = FALSE;
  } 
}
?>


Bookmark and Share

1 comment

Anonymous's picture

WYSIWYG module is the way of the future. I recommend dropping the FCK module and just using the FCK editor in the WYSIWYG module.

http://drupal.org/project/wysiwyg

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • 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>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options