3

I have 2 Drupal sites running on Drupal 7. How can I add the full HTML format, and attach CKEditor to it?

5 Answers 5

7

Installation / Configuration

  1. Unzip the module files to the "sites/all/modules" directory. It should now contain a "ckeditor" directory.
  2. Download standalone CKEditor from http://ckeditor.com/download. Unzip the contents of the "ckeditor" directory from the installation package to the "sites/all/modules/ckeditor/ckeditor" (or "sites/all/libraries/ckeditor") directory. Note: you can skip uploading the "_samples" and "_source" folders.
  3. Enable the module in the "Administration panel > Modules > User Interface" section.
  4. Grant permissions for using CKEditor in the "Administration panel > People > Permissions" section. Note: In order to enable the file browser, refer to the "Installing CKFinder" section.
  5. Adjust CKEditor profiles in the "Administration panel > Configuration > Content Authoring > CKEditor" section. Profiles determine which options are available to users based on the input format system.
  6. For the Rich Text Editing to work you also need to configure your filters for the users that may access Rich Text Editing. Either grant those users Full HTML access or use the following tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption> <tbody> To make copying the list easier, below all tags were placed in one line: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption> <tbody> If you are going to use CKEditor with the Filtered HTML input format, please refer to the "HTML Filters and Inline Styling" section.
  7. To have better control over line breaks, you may disable the line break converter for a given text format in the "Administration panel > Configuration > Content authoring > Text formats" section (recommended).
  8. Modify the ckeditor.config.js file to adjust it to your needs (optional). Configuration options are described here: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html Developer's documentation for CKEditor: http://docs.cksource.com/CKEditor_3.x/Developers_Guide WARNING: Remember to clear the browser cache after you have modified any of the JavaScript files. If you skip this step, you may notice that the browser is ignoring your changes.
1
3

CKEditor version 4 presents the error "version of CKEditor could not be detected" when installed in Drupal 7. This is due to a change of quote marks in CKEditor V4. It can be solved by editing the modules/wysiwyg/editors/ckeditor.inc about line 81:

if (preg_match('@version:\'(?:CKEditor)?([\d.]+)(?:.+revision:\'([\d]+))?@', $line, $version)) {

to

if (preg_match('@version:\"(?:CKEditor)?([\d.]+)(?:.+revision:\"([\d]+))?@', $line, $version)) {

After I did this, I was getting the following error: "PDOException SQLSTATE 42S02". I also had to uninstall and reenable WYSIWYG to get it working.

2
  • 1
    Changing a contributed module is not safe since there is a possibility of losing code when we update. See alternatives stackoverflow.com/a/1634086
    – niksmac
    Jun 5, 2013 at 3:35
  • This issue is now resolved. I've just performed an update on a site to CKEditor 4 and the latest CKEditor module and the version was recognised fine. There was one catch though. Download the Full version and use that. I started with a customised download. It didn't find it at all.
    – Gold
    Jan 10, 2016 at 23:50
1

It may be helpful to know that this error can be quickly fixed by using an older stable version of the ckeditor library (i.e. 3.6.6.1). Just look for "CKEditor 3.6.6.1 (20 Feb 2013)" under "Older Versions" on the CKEditor download page and download this to sites/all/libraries instead. This worked for me with Drupal 7.22 and Wysiwyg 7.x-2.2.

1

CKEditor version 4 presents the error "version of CKEditor could not be detected" The dev version https://drupal.org/project/WYSIWYG 7.x-2.x-dev solved this issue without hacking or dublicating the "ckeditor" folder in the "Libraries" folder

1
  • Be careful with the dev version of WYSIWYG module and CKEditor 4, you'll want this patch drupal.org/node/1956778 or you run the risk of losing data Nov 26, 2013 at 22:50
0

I think the simple solution would be to get the "7.x-2.x-dev" from https://www.drupal.org/project/wysiwyg

This a developer version but work fine and I have not witnesses any problems yet.

CKeditor has changed a lot in past years. And older solution like editing CKeditor.inc file does not work anymore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.