I have installed ckeditor standard and want to have text colour and background colour. I installed the colordialog and panelbutton plugins an am using the following code, any ideas?
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For plete reference see:
// !/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbar = [
[ 'SpecialChar', 'Bold', 'Italic', 'Strike', 'Underline',{ name: 'colors', items: [ 'TextColor', 'BGColor' ] }]
];
config.removePlugins = 'elementspath';
config.resize_enabled = false;
config.extraPlugins = 'colordialog';
};
I have installed ckeditor standard and want to have text colour and background colour. I installed the colordialog and panelbutton plugins an am using the following code, any ideas?
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For plete reference see:
// http://docs.ckeditor./#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbar = [
[ 'SpecialChar', 'Bold', 'Italic', 'Strike', 'Underline',{ name: 'colors', items: [ 'TextColor', 'BGColor' ] }]
];
config.removePlugins = 'elementspath';
config.resize_enabled = false;
config.extraPlugins = 'colordialog';
};
Share
Improve this question
asked Sep 1, 2014 at 19:01
JakeJake
3,4867 gold badges41 silver badges60 bronze badges
2 Answers
Reset to default 2For CKEditor4 - if you are using the full package and not trying to add the color plugin to the basic or standard packages, then the toolbar name is 'TextColor'. And background color is 'BGColor'
config.toolbar = [['TextColor', 'BGColor']]
You need the colorbutton plugin, not the colordialog. Actually, you can use both, because color dialog extends color button. Color button gives you the buttons to set foreground and background colors and color dialog adds a button inside basic color picker that let's you choose from more colors. See the Setting Text and Background Color sample for a live demo and code to copy.
I also remend to use the online builder, so you don't have to resolve dependencies manually. Read more about installing plugins.