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:

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


Bookmark and Share

2 comments

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

Anonymous's picture

hi,

I recommend you to drop the Fck module and just use the ckeditor which will be more ease to use.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be 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 can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <apache>, <bash>, <c>, <cpp>, <css>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>, <vim>, <xml>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options