我可以使用CKEditor没有工具栏吗? [英] Can I use CKEditor without a toolbar?

查看:208
本文介绍了我可以使用CKEditor没有工具栏吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(可能重复: CKEditor - 无工具栏

我想创建一个没有工具栏的CKEditor实例。我尝试定义一个空工具栏在实例的配置中使用

I'd like to create a CKEditor instance without a toolbar. I tried defining an empty toolbar to use in the instance's config

oConfigName.toolbar = 'Custom';
oConfigName.toolbar_Custom = [];

但我得到一个小的空工具栏,而不是工具栏。

but I get a small empty toolbar by my instance, instead of no toolbar.

我正在使用CKEditor4进行内嵌编辑

I am using inline editing with CKEditor4.

推荐答案

哇:)这是我们在实现工具栏时没有想到的东西。但我只是检查你可以删除工具栏插件,因为它不是任何其他插件需要。

Wow :) This is something that we haven't thought of while implementing toolbar. But I've just checked that you can remove toolbar plugin, because it isn't required by any other plugin.

因此构建自己的没有工具栏的CKEditor包或使用 removePlugins 配置 - 例如:

So build your own CKEditor package without toolbar or use removePlugins configuration - e.g.:

var editor = CKEDITOR.inline( 'editable', {
    removePlugins: 'toolbar'
} );

更新:在CKEditor 4.1中,高级内容过滤器。在自动模式中,它通过加载到工具栏的按钮进行配置。没有工具栏插件ACF没有配置,所以需要自己这样做:

Update: In CKEditor 4.1 the Advanced Content Filter was introduced. In its automatic mode it is configured by buttons which are loaded to toolbar. Without toolbar plugin ACF is not configured, so one need to do this on his own:

var editor = CKEDITOR.inline( 'editable', {
    removePlugins: 'toolbar',
    allowedContent: 'p h1 h2 strong em; a[!href]; img[!src,width,height];'
} );

这篇关于我可以使用CKEditor没有工具栏吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆