User Tools

Site Tools

Translations of this page:

plugin:ckeditor

CKEditor

Compatible with version

3.x

plugin This plugin provides CKEditor, an HTML text editor, for editing messages and templates. This is for phplist 3.x.

Repository
Source

Tagged with editor

By Duncan Cameron

This plugin provides CKEditor for editing messages and templates. It also integrates the KCFinder file manager to provide file uploading and browsing.

Installation

This plugin is now included in phplist, but see the README file on the GitHub page https://github.com/bramley/phplist-plugin-ckeditor for how to install or upgrade the plugin.

Configuration

config.php

The UPLOADIMAGES_DIR value in config.php must be set to the location of a directory where KCFinder can store uploaded images. The directory must be writable by the web server. Note that the value is relative to the web root and must not contain a leading '/'.

If the UPLOADIMAGES_DIR value in config.php is set to false then kcFinder will be disabled and image uploading will not be possible.

Settings page

The Settings page has a CKEditor group where you can configure the plugin.

  • The URL of ckeditor.js
  • The website path to a custom configuration file.
  • The width and height of the editor window.
  • You can select to generate a full HTML page when editing a message template. The template will then include <html>, <head> and <body> elements. This setting defaults to Yes.
  • Similarly you can select to generate a full HTML page when editing a message. This is useful only when you do not use templates, otherwise the template and the message will both contain <html>, <head> and <body> elements. The default value is No. If this field is set to Yes then it is ignored if Allow templates to be edited as full HTML pages is also set to Yes.
  • The website path to KCFinder.
  • In some web server configurations the plugin will not be able to correctly derive the file system path to the upload image directory from the value of UPLOADIMAGES_DIR. The plugin will show a message similar to this
    Image browsing is not available because directory “/xxx/xxx” does not exist or is not writeable.
    If the file system path in the message is wrong but the value of UPLOADIMAGES_DIR is correct, then you can enter the actual file system path that should be used.
  • KCFinder will create sub-directories within the image upload directory to store images, flash files and other files. If you need to then you can change the name of a sub-directory from the default value.

Custom configuration

Other settings for the editor can be placed in a custom configuration file. This file needs to be within the web root and its location specified on the Settings page. A sample custom configuration file CKEditorPlugin/sample.ckconfig.js is provided which can be used as the basis for your own settings.

See http://docs.ckeditor.com/#!/api/CKEDITOR.config for how to specify configuration settings.

Styles

Style definitions can be specified in the custom configuration file, and they will then appear in the Styles drop-down list when editing a message. Additionally, a CSS stylesheet file can be parsed to provide the style definitions. The sample custom configuration file has an example of how to define styles.

See http://docs.ckeditor.com/#!/guide/dev_styles

Location of CKEditor

Starting in version 2.1.0 of the plugin CKEditor is loaded from its Content Delivery Network. Earlier versions of the plugin included a copy of CKEditor but that is no longer the case.

If you want to customise CKEditor, such as by adding further plugins to it, then you can install a local copy. You must then enter the URL for ckeditor.js in the CKEditor group on the Settings page. For example, if you installed CKEditor in the directory ckeditor_4.5.6 of your web site then the setting would be /ckeditor_4.5.6/ckeditor.js.

Upgrade CKEditor

The plugin will not automatically upgrade to a new release of the CKEditor package. To see whether there is a later release, or to use either the Basic or the Standard package, visit http://ckeditor.com/download#cdn-row, then modify the setting “URL of ckeditor.js” on the Settings page.

Upgrade KCFinder

The plugin includes KCFinder 3.12 but will not automatically upgrade to a new release. You can check for a new release of KCFinder from http://kcfinder.sunhater.com/download.

To install the build, expand the zip file, copy the kcfinder directory to your web site, and specify the path to the directory on the Settings page. It is recommended to use a new directory rather than overwriting the KCFinder version in the plugin's directory, so that it will not be affected if you upgrade the plugin.

Upgrade from phplist 2.10.x with FCKEditor

In phplist 2.10 the FCKIMAGES_DIR value in config.php defines the directory into which images will be uploaded. The value is relative to the phplist root directory.

In phplist 3.x a different value, UPLOADIMAGES_DIR, is used to define the directory. This value is relative to the web root, not to the phplist root directory. To continue using the same upload directory you must set UPLOADIMAGES_DIR correctly. So, for example, if the existing image upload directory is /lists/uploadimages then the FCKIMAGES_DIR would be uploadimages but the value for UPLOADIMAGES_DIR would be lists/uploadimages.

Issues

Image browsing is not available because directory "/xxxx" does not exist or is not writeable

This message means that there is probably an error in the value specified for UPLOADIMAGES_DIR in the config.php file. The value needs to be the path from the web root (not the full file system path).

For example, on a server using CPanel, using the default value of uploadimages there needs to be a directory /home/xxx/public_html/uploadimages that is writeable.

Alternatively, if you want the upload directory to be within the /lists directory then UPLOADIMAGES_DIR should be set to lists/uploadimages and the directory /home/xxx/public_html/lists/uploadimages must exist and be writeable.

There can be some cases when the plugin displays this message but the directory does exist. This can happen when the web server uses a non-standard DOCUMENT_ROOT or uses symbolic file links. If this is the case then you can specify the actual file system path for the upload directory in the CKEditor group on the Settings page

Warning, Unknown failure

This message can be displayed when a symbolic link is used for the file upload directory, which triggers a bug in the KCFinder file browser. Version 2.1.3 of this plugin has some processing to try to work around this problem, so ensure that you are using version 2.1.3 or later. You can verify this on the Manage Plugins page.

If the error still occurs then you can try setting the file system path for the upload directory explicitly in the CKEditor group on the Settings page

You don’t have permissions to browse server

If you get the message You don’t have permissions to browse server or You don’t have permissions to upload files when trying to browse or upload images then there is likely a problem with the php session configuration.


See the KCFinder documentation for an explanation.

To avoid this problem you should use the default session handling with phplist. In particular do not use the phplist option to store sessions in a database table, as the session will not be accessible to KCFinder.

If you cannot resolve the problem then a work-around is to change one line in the KCFinder config file, setting disabled to false, as explained in the KCFinder documentation.

Support

Please raise any questions or problems in the user forum https://discuss.phplist.org/

plugin/ckeditor.txt · Last modified: 2018/09/30 22:05 by duncanc

Resources
Contact Us

e: info@phplist.com

Boring Bit

phpList is a registered limited company

UK Company No. 07582966

VAT Registration 122 0788 37

© phpList 2016