Home > Open Source, Technology > Integrating IMCE Drupal module with CiviCRM CKEditor

Integrating IMCE Drupal module with CiviCRM CKEditor

CiviCRM comes with CKEditor as a default wysiwyg editor. One of the missing feature has been ability to upload /browse existing files on the server using CKEditor. So after some investigation I figured out you can easily integrate IMCE drupal module for this purpose.

Here are the steps:
1. Install IMCE module: http://drupal.org/project/imce
2. Modify packages/ckeditor/config.js

Index: config.js
===================================================================
— config.js (revision 31357)
+++ config.js (working copy)
@@ -9,6 +9,10 @@
// config.language = ‘fr’;
//config.uiColor = ‘#AADC6E’;

+ config.filebrowserBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;
+ config.filebrowserImageBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;
+ config.filebrowserFlashBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;
+
// disable auto spell check
config.scayt_autoStartup = false;

3. Clear you browser cache
4. That’t it, now when you click on image icon you will get option to “Browse Server”, using which you can browse existing file or upload new files on the server.

By default you can browse / upload files only to files directory.

Sorry joomla people.. this will work only for drupal.

  1. Mark Jan 17th, 2011 @ 04:42 | #1

    this is a great help! Thanks for posting
    But when I make the adjustments to teh config file I get an error on this line
    + config.filebrowserBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;

    Not sure whats happening?

    any thoughts

  2. kurund Jan 17th, 2011 @ 11:24 | #2

    It should be ( without + )

    config.filebrowserBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;
    config.filebrowserImageBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;
    config.filebrowserFlashBrowseUrl = ‘/index.php?q=imce&app=ckeditor|url@txtUrl|width@txtWidth|height@txtHeight’;

    Hope that helps

  3. Madelynn Sep 12th, 2011 @ 19:41 | #3

    I’m not sure the date of this posting, but I tried the above code in CCRM version 3.4 and it doesn’t appear to work. Can you help?

  4. Kurund Jalmi Sep 19th, 2011 @ 23:51 | #4

    For 3.4 you can use the same drupal’s wysiwyg editor in CiviCRM. So you won’t need above changes.

  5. Madelynn Sep 20th, 2011 @ 19:02 | #5

    We don’t use the wysiwyg editor in Drupal, we use CKEditor and would like the toolbar to be consistent for both Drupal and CiviCRM.

Submitting Comment, Give me a second...

Leave a comment

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackbacks & Pingbacks ( 0 )
  1. No trackbacks yet.