django-ckeditor自定义工具栏下ckeditor_wiris插件无法显示如何解决
问题原因
配置中误用了插件名作为工具栏按钮标识。ckeditor_wiris是插件的注册名称,需在extraPlugins中声明没错,但该插件实际对外暴露的工具栏按钮为MathType(公式编辑)和ChemType(化学公式编辑),你需要将对应按钮名加入自定义工具栏配置即可生效。
调整后配置示例
CKEDITOR_CONFIGS = { 'default': { 'height':'250px', 'width':'100%', 'tabSpaces': 4, 'toolbar': 'Custom', 'toolbar_Custom': [ # 替换原ckeditor_wiris为实际按钮名,可按需只保留其中一个 ['Smiley', 'CodeSnippet', 'Symbol', 'MathType', 'ChemType'], ['Bold', 'Italic', 'Underline', 'RemoveFormat', 'Blockquote'], ['TextColor', 'BGColor'], ['Link', 'Unlink'], ['NumberedList', 'BulletedList'], ['Maximize'] ], 'extraPlugins': ','.join(['codesnippet', 'symbol', 'ckeditor_wiris' ]), } }
补充验证操作
修改配置后重启Django服务,若按钮仍未加载,可执行python manage.py collectstatic,确保wiris插件的静态资源被正确收集到项目静态目录。
内容的提问来源于stack exchange,提问作者lab17ahnaf
相关产品推荐
相关产品推荐

