ckeditor logo
Read Time:48 Second

ckeditor logoHere are a few tips for configuring CKEditor.

 

Skin the Rich Text Area:

To skin the textarea, simply include the following config:

{codecitation class=”brush: js;”}CKEDITOR.config.contentsCss = ‘ckeditor/contents.css’;{/codecitation}
[Contents.css is packed with the default download and is ready to be configured]

Make sure to clear your cache or the textarea might fail to show the custom styles.

 

Custom Toolbars

To create a set of custom toolbars, use the following rule:

{codecitation class=”brush: js;”}CKEDITOR.replace( ‘textareaId’, {
toolbar :
[[‘Bold’, ‘Italic’, ‘Underline’, ‘-‘, ‘NumberedList’, ‘BulletedList’, ‘-‘, ‘FontSize’,’TextColor’]]
});{/codecitation}

 

Line Break Settings

Defining Configurations In-Page

{codecitation class=”brush: js;”}CKEDITOR.replace( ‘editor1’, {
toolbar : ‘basic’,
uiColor : ‘# 9AB8F3’,
enterMode : CKEDITOR.ENTER_BR,
shiftEnterMode : CKEDITOR.ENTER_P
});{/codecitation}

 

Using the config.js File

{codecitation class=”brush: js;”}CKEDITOR.editorConfig = function( config ) {
config.language = ‘fr’;
config.uiColor = ‘#AADC6E’;
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
};{/codecitation}

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %