我的 CKEDITOR 有问题。我尝试自定义工具栏以仅包含我想要的按钮,但是当我尝试将工具栏放入代码中时,我的网络应用程序上的 ckeditor 中没有工具栏。我的意思是我的 ckeditor 已创建,但没有工具栏。
这是我的 JavaScript 代码:
var editor = CKEDITOR.replace( 'professionnal_mailtemplate_response_template', {
toolbar: [
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 'TextColor', 'BGColor' ] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'links', items: [ 'Link' ] }
]
} );
CKFinder.setupCKEditor( editor, '/../js/ckfinder/' )
有人可以帮助我吗?因为我搜索过,但暂时没有发现问题所在。
提前致谢!!!
最佳答案
我相信,使用此配置,您需要使用 toolbarGroups 属性,而不是 toolbar:
var editor = CKEDITOR.replace( 'professionnal_mailtemplate_response_template', {
toolbarGroups: [
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 'TextColor', 'BGColor' ] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'links', items: [ 'Link' ] }
]
} );
关于javascript - 如何在ckeditor中自定义工具栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48323319/