Saturday, September 03, 2011

FCKEditor for Mediawiki 1.17: WYSIWYG based on CKEditor

Mediawiki is not longer supporting the deprecated FCKEditor. The new CKEditor is supported through the WYSIWYG extension. I tried WYSIWYG 1.5.6 in my a new installation of Mediawiki 1.17.0 but I would get nothing everytime I would try to switch to the Rich Editor.

Debugging with Firebug I found a variable not defined error: "CKEDITOR is not defined". This was a result of addType directives in wiki/extensions/WYSIWYG/ckeditor/.htaccess. You either need to comment the lines or move the file (rename it, delete it or move it to somewhere else)

So below are the commands to get your WYSIWYG editor working in Mediawiki:
$ unzip wysiwyg-1.5.6_0.zip
$ sudo cp -R extensions/WYSIWYG /var/www/wiki/extensions/
$ sudo chown -R www-data:www-data /var/www/wiki/
$ sudo mv /var/www/wiki/extensions/WYSIWYG/ckeditor/.htaccess /var/www/wiki/extensions/WYSIWYG/ckeditor/.htaccess.old
$ sudo vi /var/www/wiki/LocalSettings.php
  require_once("$IP/extensions/WYSIWYG/WYSIWYG.php");
  $wgGroupPermissions['*']['wysiwyg']=true;

3 comments:

Sahel said...

Ok so this is great. but i'm a bit unclear.
things to do to get it working in 1.17
1) remove, commend or move the .htacess file in wiki/extensions/WYSIWYG/ckeditor/.htaccess

2) then where do we add the code that you have posted above - is it in the htacess file or in any other file or is just removing the .htaccess file enough to get it working

thanks man, we need this.

Sahel said...

Ok so, taking a closr look. Line 1 is to unzip and then with 2 to place it within extensions folder. And then you renamed .htaccess into .htaccess.old. Then lines 6 and 7 are what is to be added to enable the extension in localsettings file. So in essence for someone who has installed wyswyg 1.5.6 I just have to rename .htaccess file to .htaccess.old and leave the rest.

I just tried it but no chnage, am i missing somehting?

Nestor Urquiza said...

Did you add the two lines in LocalSettings.php?

I have followed these steps in two different brand new installations of mediawiki (in fact migrations as I posted in a recent tutorial) and they worked for me. I did all that in Ubuntu.

Before getting to all these posts about Mediawiki I have to say I had to install from scratch several times.

Hopefully you will figure what is wrong in your case.

Thanks!
-Nestor

Followers