Django CKEditor Toolbar Settings

I have a django website and everything was fine before I installed ckeditor. It works correctly, but I canโ€™t change the toolbar configuration to Full. If I write it in the settings.py file as follows:

CKEDITOR_CONFIGS = { 'Awesome': { 'toolbar': 'Full', 'width': 900, }} 

I have an editor block with a width of 900 pixels, but the toolbar is only in 1 line and 13 buttons instead of 3 rows and a huge number of buttons. If I changed "Full" to "Basic", then my toolbar will be reduced to 3 buttons.

I know that I need to change the settings in the config.js file in the ckeditor folder, but the toolbar settings do not work. I tried to make a mini toolbar:

 config.toolbar = [ [ 'Source', '-', 'Bold', 'Italic' ] ]; 

Tried to make a complete toolbar:

  config.toolbar_Full = [ { name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] }, { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] }, { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ] }, '/', { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] }, { name: 'colors', items : [ 'TextColor','BGColor' ] }, { name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] } ]; 

I tried to delete or change the ckeditor settings in the settings.py file of my project, after each change I restarted the server, but nothing happened = (

The config.js file works, you can add a button that hides the toolbar

 config.toolbarCanCollapse = true; 

And it works fine =)

What should I do to make a really complete toolbar like this ? My brain explodes, so I will be very happy if someone helps me! And sorry for my terrible English ...

+5
source share
2 answers

heres snippet from django ckeditor toolbar settings. It is not complete, but you can add it to get what you want.

  'toolbar': [["Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker"], ['NumberedList', 'BulletedList', "Indent", "Outdent", 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ["Image", "Table", "Link", "Unlink", "Anchor", "SectionLink", "Subscript", "Superscript"], ['Undo', 'Redo'], ["Source"], ["Maximize"]], 

In a separate note, id recommends using the built-in jkccriptor ckeditor, if possible in your django suggestion. I have been using the django version for a long time, and its probative peak will be a serious headache for your reason mentioned above, among other reasons.

+4
source

I just found the full toolbar settings in the CKEditor docs here: Complete toolbar customization

To create an editor instance with a full toolbar, you do not need to install anything. Just leave the toolbar and toolbars with default values โ€‹โ€‹of zero.

So django-ckeditor config will be,

 CKEDITOR_CONFIGS = { 'default': { 'toolbar': None, }, } 

And it works :)

+7
source

Source: https://habr.com/ru/post/1202147/


All Articles