OpenContent icon indicating copy to clipboard operation
OpenContent copied to clipboard

CKeditor options not working in 5.0.6?

Open b-creative opened this issue 1 year ago • 9 comments

Do the ckeditor options, the ones one can apply in options.json (like bodyClass, clipboard_handleImages, contentsCss, customConfig, disableNativeSpellChecker, extraAllowedContent, extraPlugins, format_tags, stylesSet, toolbar, etc) not work in version 5.0.6?

b-creative avatar Jul 19 '23 08:07 b-creative

No, that's not implemented yet unless you use an edit.js file AFAIK

Timo-Breumelhof avatar Aug 01 '23 12:08 Timo-Breumelhof

What do you mean by: 'an edit.js file'? What can I do to get this working? Do I copy this from an older version?

b-creative avatar Aug 01 '23 12:08 b-creative

No, it's a new option. (edit.js is not, but the way you do this is). It's will also make the filed available in the builder (which is one of the great things of the new VUE editor) I have used it but the examples are a bit complex to post here. I'll try to add a simpler version to one of the demo templates.

Timo-Breumelhof avatar Nov 21 '23 10:11 Timo-Breumelhof

Timo, did you manage to add this to a demo template? I really would like to implement a more streamlined ck-editor; you can also send me the complex one :)

Thanks!!

b-creative avatar Nov 27 '23 17:11 b-creative

I have used edit.js for other things, but I did not manage to load a custom editor config yet (tried today). I asked Sacha for assistance and will get back to you when I get it fixed.

Timo-Breumelhof avatar Dec 15 '23 13:12 Timo-Breumelhof

At the moment I succesful use this edit.js file, which I only need to place in the template folder.

window.Lama.getFieldComponent('ckeditor').computed.editorConfig = function () { return { toolbar: [ { name: "clipboard", items: [ "Cut", "Copy", "PasteText", "-", "Undo", "Redo", ], }, { name: "editing", items: [ "SpellChecker", "Scayt", ], }, { name: "insert", items: [ "Table", "SpecialChar" ], }, { name: "basicstyles", items: [ "Bold", "Italic", "Underline", "Subscript", "Superscript", "-", "RemoveFormat", ], }, { name: "paragraph", items: [ "NumberedList", "BulletedList", ], }, { name: "links", items: ["Link", "Unlink", "Anchor"] }, { name: "styles", items: ["Styles", "Format"] }, { name: "tools", items: ["Maximize", "ShowBlocks", "-", "Source"], }, ], // Set the most common block elements. bodyClass: "editorbody", format_tags: "p;h2;h3", //http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent allowedContentRules: true, startupOutlineBlocks: true, // Simplify the dialog windows. removeDialogTabs: "image:advanced", // Remove one plugin. removePlugins: "link,easyimage", extraPlugins: "dnnpages", linkShowAdvancedTab: true, //autoGrow_onStartup : true, //autoGrow_minHeight : 400, //autoGrow_maxHeight : 700, height: 400, //skin : 'flat', contentsCss: "/portals/0-System/_lay-out/css/editor.css?v-2", customConfig: "/portals/0-System/_lay-out/js/ckeditor_settings_modifier/config.js", stylesSet: [ { "name": "Blok blauw", "element": "div","attributes": { "class": "alert alert-primary" } }, { "name": "Blok grijs", "element": "div","attributes": { "class": "alert alert-dark" } }, { "name": "Blok groen", "element": "div","attributes": { "class": "alert alert-success" } }, { "name": "Knop", "element": "a", "attributes": { "class": "btn btn-primary" } } ], //easyimage_toolbar :['EasyImageAlignLeft', 'EasyImageAlignCenter', 'EasyImageAlignRight'] }; };

b-creative avatar Dec 16 '23 09:12 b-creative

With that ofcourse I use the extra editor.css and config.js. As a Bootstrap frame user, I also wrote an extra wrapping around the table.table, using: $("table.table").wrap("<div class='table-responsive'></div>");

b-creative avatar Dec 16 '23 09:12 b-creative

Ah ok. I was trying to create a custom field based off the CkEditor field, which would then also be supported in the builder. (which is what I have been doing with other fields too, but that was to manipulate the data) But your example is less complicated :-)

Timo-Breumelhof avatar Dec 18 '23 10:12 Timo-Breumelhof

Does the extra plugin dnnpages still work for you in OC5.1.1? Mine generates an error...

b-creative avatar May 29 '24 15:05 b-creative