Integrating CKEditor into the ErfurtWiki system

Today I was trying to integrate CKEditor into the wiki system called ErfurtWiki, which I use as an internal documentation for one of my projects. The reason why I decided to use CKEditor is problem with encoding of czech characters in ErfurtWiki. Those characters are transformed into the html entities, which makes the topics hard to read when editing again.
But implementation of CKEditor in this case is not as easy as one would expect. The problem here is with html tags, which are also automatically transformed into the html entities. So when the topic is saved html tags appear as text.
To allow use html tags in topics in ErfurtWiki follow these steps:


Set follwing constants:
define(“EWIKI_ALLOW_HTML”, 1);
define(“EWIKI_HTML_CHARS”, 1);

Disable transformation of html tags into html entities:
$ewiki_config[“htmlentities”] = array();

And finally change the textarea to appear as CKEditor:
<script type=”text/javascript”>
window.onload = function()
{
CKEDITOR.replace(‘ewiki_content’, {
toolbar : [
[ ‘Source’ ]
],
forceEnterMode : true,
forcePasteAsPlainText : true,
enterMode : CKEDITOR.ENTER_BR
});
};
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *