How to configure ckeditor to not wrap content in block?

Add the following to your config.js file for CKEditor: config.enterMode = CKEDITOR.ENTER_BR; Example: … CKEDITOR.editorConfig = function (config) { config.enterMode = CKEDITOR.ENTER_BR; … }; Details The configuration setting that controls this behavior is based on what you want to happen when the user presses Enter. Just in case someone who’s new to working with HTML … Read more

How can I get the content of CKEditor using JQuery?

use the CKEditor.editor.getData() call on the instance. That is to say: HTML <textarea id=”my-editor”> <input id=”send” type=”button” value=”Send”> JS for CKEditor 4.0.x $(‘#send’).click(function() { var value = CKEDITOR.instances[‘DOM-ID-HERE’].getData() // send your ajax request with value // profit! }); JS for CKEditor 3.6.x var editor = CKEDITOR.editor.replace(‘my-editor’); $(‘#send’).click(function() { var value = editor.getData(); // send your … Read more

How to add a custom button to the toolbar that calls a JavaScript function?

Also there is a nice way allowing one to add the button without creating plugin. html: <textarea id=”container”>How are you!</textarea> javascript: editor = CKEDITOR.replace(‘container’); // bind editor editor.addCommand(“mySimpleCommand”, { // create named command exec: function(edt) { alert(edt.getData()); } }); editor.ui.addButton(‘SuperButton’, { // add new button and bind our command label: “Click me”, command: ‘mySimpleCommand’, toolbar: … Read more

Turn off enclosing tags in CKEditor 3.0

CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR; – this works perfectly for me. Have you tried clearing your browser cache – this is an issue sometimes. You can also check it out with the jQuery adapter: <script type=”text/javascript” src=”https://stackoverflow.com/js/ckeditor/ckeditor.js”></script> <script type=”text/javascript” src=”/js/ckeditor/adapters/jquery.js”></script> <script type=”text/javascript”> $(function() { $(‘#your_textarea’).ckeditor({ toolbar: ‘Full’, enterMode : CKEDITOR.ENTER_BR, shiftEnterMode: CKEDITOR.ENTER_P }); }); </script> UPDATE according … Read more

How to set the height of CKEditor 5 (Classic Editor)

Answering my own question as it might help others. CKEditor 5 no longer comes with a configuration setting to change its height. The height can be easily controlled with CSS. There is one tricky thing though, if you use the Classic Editor: <div id=”editor1″></div> ClassicEditor .create( document.querySelector( ‘#editor1’ ) ) .then( editor => { // … Read more

How can you integrate a custom file browser/uploader with CKEditor?

Start by registering your custom browser/uploader when you instantiate CKEditor. You can designate different URLs for an image browser vs. a general file browser. <script type=”text/javascript”> CKEDITOR.replace(‘content’, { filebrowserBrowseUrl : ‘/browser/browse/type/all’, filebrowserUploadUrl : ‘/browser/upload/type/all’, filebrowserImageBrowseUrl : ‘/browser/browse/type/image’, filebrowserImageUploadUrl : ‘/browser/upload/type/image’, filebrowserWindowWidth : 800, filebrowserWindowHeight : 500 }); </script> Your custom code will receive a GET … Read more

CKEditor automatically strips classes from div

Disabling content filtering The easiest solution is going to the config.js and setting: config.allowedContent = true; (Remember to clear browser’s cache). Then CKEditor stops filtering the inputted content at all. However, this will totally disable content filtering which is one of the most important CKEditor features. Configuring content filtering You can also configure CKEditor’s content … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)