Load blockquote plugin in CKEditor

一笑奈何 提交于 2020-01-13 11:08:10

问题


I want to use CKEditor via django-ckeditor.

CKEditor gets loaded, but I fail to load the blockquote plugin.

  • I downloaded blockquote.zip, unpacked it
  • Copied it to my app like this myapp/static/ckeditor/ckeditor/plugins/blockquote
  • I run collectstatic. I can access the blockquote/plugin.js file via browser if I inter the URL by hand.
  • I updated the config:

    CKEDITOR_CONFIGS = { 'default': { 'extraPlugins': 'blockquote', } }

  • The HTML contains the blockquote: <textarea cols="40" id="id_body" name="body" rows="10" data-processed="0" data-config='... "extraPlugins": "blockquote", ...' data-external-plugin-resources='[]'

But the plugin does not get loaded. I looked checked it with the firefox network debugger. These file gets loaded ckeditor-init.js, ckeditor.js, config.js', but not a single file ofblockquote`.

Related issue: https://github.com/django-ckeditor/django-ckeditor/issues/261

How to load the blockquote plugin in CKEditor?

Update In the other question the author sees requests to "codesnippet/plugin.js". In my case I don't see any access to the plugin.js file of blockquote.


回答1:


I use django_ckeditor and blockquote, but did not need to add it as an extra plugin. Are you sure you really need to do it that way? One thing that I'm thinking is the problem is that you define the extra plugin, but you don't put it in any of your toolbars. Perhaps it doesn't load if it's not defined in a toolbar. Have you tried updating your toolbars?

Here's my example config:

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar_Basic': [
            ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
            ['Undo', 'Redo'],
            ['Scayt'],
            ['Link', 'Unlink', 'Anchor'],
            ['Source'],
            ['Maximize'],
            ['Bold', 'Italic', 'Underline', 'RemoveFormat'],
            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'],
        ],
        'toolbar': 'Basic',
    },
}



回答2:


I don't use Django, so I apologize if this is off base.

Is the folder structure setup properly with ckeditor as a subfolder of ckeditor?

or should it be myapp/static/ckeditor/plugins/blockquote?



来源:https://stackoverflow.com/questions/36028699/load-blockquote-plugin-in-ckeditor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!