Skip to content

CKEditor Configuration

Jens Brückner edited this page Jun 4, 2013 · 6 revisions

How to adjust the appearance of the CKEditor in the backend of phpwcms without editing the CKEditor core files.

To see all possible options checkt the CKEditor 4 documentation.

  1. Remove unwanted buttons
    Edit template/config/ckeditor/ckeditor.config.js and insert the names of all unwanted buttons here:
    config.removeButtons = 'TextColor,BGColor,Styles,Copy,Iframe,Flash,Smiley,PageBreak,Font,FontSize,Save,Print,NewPage,Preview,Templates,PasteFromWord,PasteText';

  2. Definition of allowed format tags (in the following example, only p, h5 and h6 allowed)
    Edit template/config/ckeditor/ckeditor.config.js and insert the following configuration definition:
    config.format_tags = 'h5;h6;p';

  3. Linking the CKEditor to the phpwcms frontend.css (to have the same appearance of the styles same as the front end)
    Edit template/config/ckeditor/ckeditor.config.js and insert the following configuration definition:
    config.contentsCss = 'template/inc_css/frontend.css';

  4. Avoid HTML entities
    Edit template/config/ckeditor/ckeditor.config.js and insert the following configuration definition:
    config.entities = false;

  5. Disable automatic filling of empty blocks. No more non breaking space, eg. <th></th> instead of <th>&nbsp;</th> config.fillEmptyBlocks = false;

  6. Force paste as plain text
    Whether to force all pasting operations to insert on plain text into the editor, loosing any formatting information possibly available in the source text (defaults to false):
    config.forcePasteAsPlainText = true;

To activate the new configuration, empty browser cache and force browser to refresh.