Install CKEditor

 ADD CKeditor To Page

To use the ckeditor we need to include the ckeditor.js file located in root file of the ckeditor library.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>A Simple Page with CKEditor</title>
        <!-- Make sure the path to CKEditor is correct. -->
        <script src="/path/to/ckeditor/ckeditor.js"></script>
    </head>
    <body>
        <form>
            <!--
            This textarea field will be replaced with the wysiwyg(ckeditor)
            NOTE: the id, we need this to tell the editor which textarea to replace.
            -->
            <textarea name="editor1" id="editor1" rows="10" cols="80">
                This is my textarea to be replaced with CKEditor.
            </textarea>
            <script>
                // Replace the <textarea id="editor1"> with a CKEditor
                // instance, using default configuration.
                //passing the id of the field to replace
                CKEDITOR.replace( 'editor1' );
            </script>
        </form>
    </body>
</html>

Avoiding Encoding Issues

To avoid problems with character encoding, use UTF-8 for your websites and your database. Just set the <meta> element for your pages to:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

if you are using html 5, use the followign instead

<meta charset="utf-8">

 

Cookbook Category: 

Add new comment