Config.js not working for CKEditor

I have the following in my config.js for CKEditor:

 CKEDITOR.editorConfig = function( config ) { config.toolbar = [ [ 'Source', '-', 'Bold', 'Italic' ] ]; // config.toolbar_Basic = // [ // [ 'Source', '-', 'Bold', 'Italic' ] // ]; // config.toolbar = 'Basic'; } 

The editor is still displayed with all the options on the toolbar.

It also downloads JS files in the correct order:

 <script src="/assets/ckeditor/init.js?body=1" type="text/javascript"></script> <script src="/assets/ckeditor/ckeditor.js?body=1" type="text/javascript"></script> <script src="/assets/ckeditor/config.js?body=1" type="text/javascript"></script> 

So I'm not sure what is going on here. Any thoughts?

It is also important to note that I tried an alternative way to declare this Basic toolbar (see the code for the commented fragment above), and it does not work either.

After each change, I restart my server.

+7
source share
5 answers

How do you load cceditor instead of a text field? The toolbar may be overridden.

+4
source

Your config.js file looks OK (both versions).

What might be wrong is how you load CKEditor. First of all - you do not need to load config.js - CKEditor will do this. Secondly, what is in the init.js file?

Did you clear the cache in your browser? On some, it can be very difficult to do this automatically.

+2
source

Download CKEditor 3.2.1 here: http://ckeditor.com/download

Extract the downloaded .tar.gz file.

Copy the contents of the ckeditor folder to / sites / all / modules / contrib / ckeditor / ckeditor

At this point, you can edit the available toolbar options by deleting unnecessary items. In most cases, I prefer the following configuration, as it provides maximum attachment, minimizing markup types that can override the site’s style.

edit / sites / all / modules / contrib / ckeditor / ckeditor.config.js

Create a new toolbar by adding the following configuration to ckeditor.config.js:

**

 config.toolbar_DrupalCustom = [ ['Source'], ['Cut','Copy','Paste','PasteText','-','SpellChecker', 'Scayt'], ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], ['Image','HorizontalRule','Smiley','SpecialChar'], ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Blockquote'], ['Link','Unlink','Anchor','LinkToNode', 'LinkToMenu'], ['Format','Font','FontSize'], ['TextColor','BGColor'], ['Maximize', 'ShowBlocks'], ['DrupalBreak', 'DrupalPageBreak'] ]; 

** Now you can select this option in the CKEditor Appearance section in / admin / settings / ckeditor / edit / Advanced

+1
source

I also had problems with CKEditor and the "caching" problem. Cleared cache, loaded user configuration file ... and timestamps ...

http://ckeditor.com/forums/CKEditor/Problem-with-config.js-not-updating

Nothing succeeded. Then I just added it as parameters when creating the editor instance:

 CKEDITOR.replace( 'controls_' + int_control_cnt + '_label_text' , { toolbar: [ ['Bold', 'Italic', 'Underline', '-', 'TextColor', '-', 'RemoveFormat'], ['Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo'] ] }); 

It did the trick

+1
source

use only: <script src="ckeditor/ckeditor.js"></script>

and be sure to clear your browser cache!

0
source

All Articles