我在我的几个网站上使用djangocms-text-ckeditor。
在其中一个例子中,我在base.py中有以下内容
CKEDITOR_SETTINGS = {
'language': '{{ language }}',
'toolbar': 'full',
'toolbar_HTMLField': [
['Undo', 'Redo'],
['ShowBlocks'],
['Format', 'Styles'],
],
'skin': 'moono-lisa',
'removePlugins': ['image'],
'extraPlugins' : [
# these are non-standard plugins
'codesnippet',
'html5audio',
'image2',
'autogrow',
],
}这提供了以下编辑器工具栏

在另一个站点上,我没有将任何内容添加到base.py中并获得以下内容

我的问题是如何在第一个站点中获得CMSPlugins部分。另外,如果我希望显式地启用所有插件,配置应该是什么样子的?
发布于 2022-01-01 16:57:59
似乎没有容易的方法来达到你所需要的。奇怪的是,'full'选项不包括CMSPlugins菜单。您可以做的是用显式工具栏配置替换CKEDITOR_SETTINGS中的CKEDITOR_SETTINGS。如果您真的需要完整的选项集,那么它可能会类似于这样--尽管如此:我没有测试这个选项,也不完全确定其中的一些选项,所以请根据您的需要调整这个选项。
# add to CKEDITOR_SETTINGS
'toolbar_CMS': [
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
['Undo', 'Redo'],
['cmsplugins', 'cmswidget'],
['Find', 'Replace'],
['SelectAll'],
['Scayt'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'HiddenField'],
['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates'],
'/',
['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'],
['CopyFormatting', 'RemoveFormat'],
['NumberedList', 'BulletedList'],
['Outdent', 'Indent'],
['Blockquote', 'CreateDiv'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['BidiLtr', 'BidiRtl', 'Language'],
['Link', 'Unlink', 'Anchor'],
['CodeSnippet', 'Image2'],
['Html5audio', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']
'/',
['Styles', '-', 'Format', '-', 'Font', '-', 'FontSize'],
['TextColor', 'BGColor'],
['About'],
['Maximize', 'ShowBlocks']
]还请看一下CKEditor工具栏配置器及其旧版本的这里 (我确信Django-CMS不使用CKEditor的最新版本)。它输出JavaScript,但作为菜单图标及其名称的概述仍然非常有用。
https://stackoverflow.com/questions/70509257
复制相似问题