How to Install FCKeditor on Drupal
After some trouble lately getting everything working, I finally have the FCKeditor WYSIWYG editor installed and working on Drupal. The official documentation leaves a little to be desired, so it seems prudent to document and share what I had to do to make it work.
I’m using Drupal 6.2, the FCKeditor module 6.x-1.2-1, and FCKeditor 2.6.
Installation
-
Install Drupal
See the Getting Started guide. Installing Drupal is beyond this scope of this tutorial.
-
Get the module
Grab it from the FCKeditor project page. Unzip the files to the
sites/all/modulesdirectory. -
Get FCKeditor
The module plugs the editor into Drupal, so you still need to get the actual editor. Unzip the files to the
sites/all/modules/fckeditordirectory, creating anfckeditordirectory inside of thefckeditordirectory. -
Enable the module
Configuration
-
Grant permissions
Go to http://example.com/admin/user/permissions. The FCKeditor module permissions are pretty self explanatory. Just make sure that the user account you’re using to set this up has all of the permissions, and that you give appropriate permissions to any other roles that you want using the editor.
-
Adjust filters
FCKeditor likely will create markup that will be stripped out by Drupals “Filtered HTML” filter. To adjust the filter, go to http://example.com/admin/settings/filters and configure that filter to allow the following tags:
<a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <img /> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <strike> <caption>. -
Customize the toolbars
Out of the box, the toolbar is a little unweildy. I like to pare it down to the some of the more useful functions.

To do this, edit the file
sites/all/modules/fckeditor/fckeditor.config.js. The easiest option is to just revise one of the pre-existing toolbars defined in this file; I usually pick the “DrupalFiltered” toolbar. The following code will give you the toolbar pictured above:FCKConfig.ToolbarSets["DrupalFiltered"] = [ ['Source', 'ShowBlocks'], ['Cut','Copy','Paste', '-','PasteText','PasteWord'], ['Undo','Redo','-','Replace','-','RemoveFormat'], '/', ['Link','Unlink','Anchor'], ['Image','Table','SpecialChar'], '/', ['FontFormat'], ['Bold','Italic','StrikeThrough'], ['OrderedList','UnorderedList','-','Blockquote'], ] ;
-
Setup profiles
The FCKeditor module allows different profiles for different user roles. For a user to use the editor, that user’s role must be associated with a profile in addition to having the “access fckeditor” permission. Set up profiles at http://example.com/admin/settings/fckeditor.
Edit the “Global Settings” to tell the module, first, the precedence of the roles for determining which profiles will be seen by users with multiple roles. Under “Visibility settings”, I highly recommend adding “admin/*” to “Paths to exclude”, so you don’t have WYSIWYG editors popping up in unexpected places in the administration screens.
Next, select one of the profiles to edit.
- Again, make sure that all roles that you want using the editor are selected under “Roles allowed to use this profile”.
- Under “Editor appearance”, set the toolbar to the one you edited earlier (”DrupalFiltered”).
- Depending on your users, you may want to limit the font formats under “Cleanup and output” to prevent the use of certain tags that don’t fit with your site’s style.
- Things can sometimes get a little buggy if you let the editor try to apply your theme’s CSS to the editor display. You’re probably better off setting the editor CSS to “FCKeditor default” under “CSS” (or see the Tips & Tricks page for a way to fix it).
- If you’re going to allow file uploads (which we’ll cover in a moment), make sure to enable file management (both basic and advanced) under “File browser settings”.
-
File uploads
Out of the box, file uploads and the file browser don’t quite work.
To enable the file browser, edit
sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php. Find the line containing$Config['UserFilesAbsolutePath'] = ” ;. Add the following line after that:require_once "../../../../../filemanager.config.php";
Then locate your Drupal settings file (probably at
sites/default/settings.php). Uncomment the line with the$cookie_domainvariable and set it to your site’s domain.Next, fix a bug to enable quick uploads. Edit
sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/io.php, replacing the line that saysvar test = window.top.opener.document.domain ;with one that saysvar test = window.parent.OnUploadCompleted ;.The quick uploader, by default, puts all of its files in the directory above that which the file browser can access. To fix this, go back to
sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php. Replace the following lines:$Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] ; $Config['QuickUploadAbsolutePath']['File'] = $Config['UserFilesAbsolutePath'] ;
with:
$Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] . 'file/' ; $Config['QuickUploadAbsolutePath']['File'] = ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
Repeat three more times, for “Image”, “Flash”, and “Media”.
And there you have it: a fully operational installation of FCKeditor on Drupal.
Have you tried integrating the upload/file management with CKEditor by chance?
Nick | 2008-05-29 19:33 | Permalink
Not sure I quite understand your question, Nick. If you mean the built-in file uploader/manager that comes with FCKeditor, then yes. See the last section, “5. File uploads”, for a run-through of what needs to be done to make that work. Or are you referring to a separate module?
Jonathan Brinley | 2008-05-29 21:33 | Permalink
I just installed fckeditor. I followed all of your instructions, but it does not show up in IE7. Is there a bug you know of in IE7 that won’t allow it to show up? It shows up in Firefox… any suggestions?
Suzanna
Suzanna | 2008-06-02 13:45 | Permalink
I haven’t come across any bugs with IE7. My first thought is that it might be related to the theme you’re using. You might try switching to the Garland theme, and see if it works then. If so, that will help you hone in on the problem.
Jonathan Brinley | 2008-06-02 14:01 | Permalink
I kept receiving a “file open for write” error when trying to upload my edited sites/default/settings.php. I am using a shared host. Any idea what or if I can do to allow me to update the file?
Thanks.
David | 2008-06-04 17:35 | Permalink
I’m using Drupal 6.2, the FCKeditor module 6.x-1.2-1, and FCKeditor 2.6.1
As soon as I enable the module I get this error on admin/settings/fckeditor: http://www.pastebin.org/44333
“…user warning: Table ‘drupal.fckeditor_settings’ doesn’t exist query:…” etc…
How to solve? Thanks.
Gand | 2008-06-17 17:53 | Permalink
Solved, probably unzip files with wrong permission; disinstalled and then reinstalled. Thanks.
Gand | 2008-06-17 18:21 | Permalink
It seems that with FCKeditor 2.6.1 there is no var test = window.top.opener.document.domain ; in file sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/io.php.
Gand | 2008-06-17 18:55 | Permalink
CKFinder is an independent program that integrates flawlessly with FCKEditor
http://www.ckfinder.com/
Lopo Lencastre de Almeida | 2008-06-20 11:42 | Permalink
Hi, in my Drupal when entering the html filter string, it only allows a limited number of characters (guess 255?) and your list doesn’t fit in there… (though I think many of those tags are very rarely used)
Mark | 2008-06-24 08:01 | Permalink
Thanks Jonathan, your how-to did help a lot.
Especially the window.parent.OnUploadCompleted thing was the bug I wouldn’t have been able to find myself.
Thank you very much. Erverything worked out for me
Peace
Marc
marc | 2008-06-26 12:58 | Permalink
I followed your instructions for installing the fckeditor except for the nesting of the extra fckeditor dir. The module does not appear in the list of other modules and I cannot therefore enable it.
All the files have root permissions, although a theme which I installed which also has root permissions, works.
I don’t know what I not doing right!
How can I do an uninstall, without having to delete each file individually?
Any, all help appreciated.
Fiona | 2008-06-26 15:18 | Permalink
Thanks! That really helped me. I kinda got lost in the File Uploads part (inserting it into the code) but that is because i am a novice and dont know how to insert it.
tess | 2008-06-28 17:22 | Permalink
I am happy !
Thanks to this page i finally managed to set up and work with FCKEditor on my Drupal 6x-dev version test site.
This module makes all the difference, being able to add images and flash presentations to my stories and pages !
Thanks
JohnnyMoney | 2008-07-04 08:10 | Permalink
Oops!
Working well with IE6 but not with Firefox 2. The images don’t show on screen in this last case for example.
Will look around and see what can be done to remedy this.
JohnnyMoney | 2008-07-05 08:01 | Permalink
Doesn’t work for me on ly localhost, some help please…
jr | 2008-08-05 10:33 | Permalink
geez…i now have fckeditor on my site!!!
Thank you for such a simplified step by step instruction. Very very helpful to us who are new to drupal.
chandra | 2008-09-14 23:25 | Permalink
Thanks! I now have a working FCKeditor with filebrowser and file upload!
Tommy | 2008-10-11 06:40 | Permalink
Great page, very useful as FCKeditor page do not even have an install doc.
Thanks
Steven | 2008-10-14 16:58 | Permalink
I can’t leave you a comment because fckEditor isn’t running in this text area. And I’m ruined now. Ruined I tell you. Thanks for nothin.
Ruined | 2008-12-05 02:12 | Permalink
FCKeditor is working, but when I try to upload a file, a whole bunch of XML errors show up in the browser window. It’s not working in Drupal 6.8!
TJOZ | 2008-12-12 11:27 | Permalink
great!
worked fine here :)
Carlos | 2008-12-26 10:09 | Permalink