CKEditor Configuration - slackero/phpwcms GitHub Wiki
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.
-
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';
-
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';
-
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';
-
Avoid HTML entities
Edit template/config/ckeditor/ckeditor.config.js and insert the following configuration definition:
config.entities = false;
-
Disable automatic filling of empty blocks. No more non breaking space, eg.
<th></th>
instead of<th> </th>
config.fillEmptyBlocks = false;
-
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 tofalse
):
config.forcePasteAsPlainText = true;
To activate the new configuration, empty browser cache and force browser to refresh.