There are several ways to integrate CKEditor into your pages. This page presents the most common way to achieve it.
Step 1: Loading CKEditor
Step 2: Creating an Editor Instance
CKEditor works just like a textarea in your page. While the editor offers a user interface to easily write, format and work with rich text, the same thing could be achieved, not that easily, with a textarea, requiring the user to type HTML code inside of it.
But, as a matter of fact, CKEditor uses a textarea to transfer its data to the server. The textarea is invisible to the end user. So, to create and editor instance you must, ironically, create a textarea first:
<textarea name="editor1"><p>Initial value.</p></textarea>
Note that, if you want to load data into the editor, from a database for example, just put that data inside the textarea, just like the above example.
In this example, we have named our textarea "editor1". This name can be used in the server side later, when receiving the posted data.
This script block must be included at any point "after" the <textarea> tag in the page. You can also call the replace function inside <head>, but you need to listen for the "window.onload" event in such case:
Step 3: Saving the Editor Data
As previously described, the editor works just like a <textarea> field. So, when submitting a form containing an editor instance, its data will be simply posted, using the textarea name as the key to retrieve it.
For example, following the above example, in PHP we would do something like this:
<?php $editor_data = $_POST[ 'editor1' ]; ?>
Client Side Data Handling
Some applications (like Ajax applications) need to handle all data at the client side, sending it to the server by its own ways. In such case, it's enough to use the CKEditor API to easily retrieve an editor instance data. For example:
Work in progress...
One of our users has put up a temporary guide here. Thank you Christiaan.