Azitech

Azimout's Linux weblog

Install CKEditor 4.0 on Drupal 7

leave a comment »

My favourite WYSIWYG editor for Drupal is CKEditor.

However, CKEditor 4.0 does not work out of the box with Drupal’s  WYSIWYG module: a regular expression needs to be changed in order to correctly detect CKEditor’s version number! So, until that’s fixed, here’s the installation instructions:

  • cd into /etc/drupal/7/sites/default, mkdir libraries and cd into it
  • download CKEditor, extract it
  • cd into /etc/drupal/7/sites/default/modules/wysiwyg/editors
  • edit the regex on line 81 of the file ckeditor.inc as follows:

from this:

if (preg_match('@version:\'(?:CKEditor )?([\d\.]+)(?:.+revision:\'([\d]+))?@', $line, $version)) {

to this:

if (preg_match('@version:\"(?:CKEditor )?([\d\.]+)(?:.+revision:\"([\d]+))?@', $line, $version)) {

(notice the two single quotes that become double quotes)

  • finally, enable and configure the WYSIWYG module from the Drupal adminstration interface

The hack is courtesy of sakseiw on http://drupal.org/node/1161738

Advertisements

Written by azimout

14/12/2012 at 18:57

Posted in Howto

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: