Can I use CKEditor without a toolbar?
I do this in ckeditor5:
ClassicEditor
.create( document.querySelector( '.editor' ), {
licenseKey: '',
toolbar: [],
} )
.then( editor => {
window.editor = editor;
editor.isReadOnly = true;
} )
.catch( error => {
console.error( 'Oops, something went wrong!' );
console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' );
console.warn( 'Build id: efxy8wt6qchd-qhxgzg9ulnyo' );
console.error( error );
} );
if you want to remove border around ckeditor 5 do this:
<style>
.ck{
border:0px !important;
}
</style>
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.
So build your own CKEditor package without toolbar or use removePlugins
configuration - e.g.:
var editor = CKEDITOR.inline( 'editable', {
removePlugins: 'toolbar'
} );
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];'
} );
In CKEditor 4.9.2:
When you instanciate the editor, set toolbar option:
CKEDITOR.replace( 'editor1', {
...
toolbar: []
});
I've turned off everything except italics, bold and underlined with this config:
CKEDITOR.editorConfig = function( config ) {
config.autoParagraph = false;
config.toolbarGroups = [
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
];
config.removeButtons = 'Strike,Subscript,Superscript,RemoveFormat';
};