CKEditor – HOWTO replace Xinha with CKEditor using PHP

I was working for a client with a custom CMS written n PHP. Who does that these days, nobody. In any case, one of the problems with the site was that it was broken in IE9 as Xinha is not really compatible with IE9; there is a way to fix this but my thinking is why bother — if it’s not being maintained it doesn’t make sense to keep using it. The two alternatives are TinyMCE and CKEditor, I chose CKEditor. And the replacement was pretty simple. Simply drop that in to some sort of path and then replace the code that intialized Xinha with code that initializes CKEditor usually in the head of the document.

CKEditor provides a class called ‘ckeditor_php5.php’ that automatically writes the code necessary for the editor to replace a css id. Simply require ckeditor_php5.php in your PHP code base and then initialize it:

You may also add configurations to the editor using the following:

Published on: 23 April 2012
Posted by: Sami K.