So, here’s a quick tutorial to embed FCKeditor, a GPL-ed WYSIWYG XHTML-compliant editor, in Dokuwiki.
First, setup FCK as the default DokuWiki editor:
- Copy the unpackaged FCK archive folder to
- We’ll use the textarea replacement method to embed FCK. So open
$BASE/inc/template.php and, after line 218, add the following instructions:
where “100%” and “600” are the editor width and height;
$BASE/inc/html.php delete/comment the following line (l.1023), to remove the original JS editor:
- You should also edit
$BASE/lib/scripts/FCKeditor/fckeditor.js and remove the following line (l.92), or FCK will complain he can’t find a textarea in the front-end pages:
alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ;
Then, we need to tell DokuWiki that pages are now written in HTML, and not using its wiki syntax:
- The first thing to do is to set
$conf['htmlok'] = 1; in
local.php if you created one);
- Next, you’ll have to open
$BASE/inc/common.php and replace the line (l. 840)
so that it will save content between <html> tags, telling Dokuwiki we’re embedding HTML;
$BASE/inc/html.php and, @ line 277, replace
so that the preview text will be also interpreted as HTML.
One of the bast feature of FCK is its images/files upload management. If you want to enable it:
_QuickUploadLanguage values to
php (l. 134).
- You’ll also need to edit (
$BASE/lib/scripts/FCKeditor/editor/filemanager/upload/php/config.php to set
$Config['UserFilesPath'] to an upload directory relative to your website root (and create + chown it so that webserver can upload files), and set
$Config['Enabled'] = true;.
That’s all, you’ve got FCKeditor running in your wiki.
At least, if want to get an easy way to create internal links (and so, new pages), you should add a rewrite rule to make your wiki interpret links like
index.php?id=foo. Using it, you’ll be able to create new pages using the FCK link editor, by adding a link with no protocol and just a page name.