1. Ckedior.js

 CKEDITOR.editorConfig = function( config ) {
    // config.filebrowserUploadUrl="/blog/upload_img/";
     config.extraPlugins = 'codesnippet';
 };

这个是必须的。

2. settings.py

CKEDITOR_CONFIGS = {
    'default': {
        'extraPlugins': 'sourcedialog,codemirror,widget,lineutils,codesnippet,selectall',
        'toolbar': 'Full',
    },
    'zinnia-content': {
        'toolbar_Zinnia': [
            ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
            ['Undo', 'Redo'],
            ['Scayt'],
            ['Link', 'Unlink', 'Anchor'],
            ['CodeSnippet', 'Image', 'Table', 'HorizontalRule', 'SpecialChar'],
            ['Source'],
            ['Maximize'],
            '/',
            ['Bold', 'Italic', 'Underline', 'Strike',
             'Subscript', 'Superscript', '-', 'RemoveFormat'],
            ['NumberedList', 'BulletedList', '-',
             'Outdent', 'Indent', '-', 'Blockquote'],
            ['Styles', 'Format'],
        ],
        'toolbar': 'Zinnia',
    },
}

Done

 

相关文章:

  • 2021-08-14
  • 2021-07-19
  • 2022-12-23
  • 2021-10-25
  • 2021-08-30
  • 2021-06-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-18
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
相关资源
相似解决方案