ckeditorClassic - Configure buttons and add source buuton
ckeditorClassic - Configure buttons and add source buuton
peterbrowne
Posts: 314Questions: 54Answers: 0
I need to change some buttons on ckeditorClassic, and add a source button to edit the source in the editor content. There is a plugin for the editor to add the source button:
https://ckeditor.com/cke4/addon/sourcearea
Any suggestions to achieve this in the datatables editor?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There are CKEditor plugins for Editor - V4 and V5. Would these work for you?
Colin
I am using the ckeditor v5 plugin on my editor. That is not the problem.
I need to configure the ckeditor toolbar to change the buttons and to use additional ckeditor plugins, e.g. add buttons for viewing the editor source and enable different list types:
https://ckeditor.com/cke4/addon/liststyle
https://ckeditor.com/docs/ckeditor4/latest/examples/sourcearea.html
I don't know where the ckeditor config is or how/where to add the toolbar options for the editor.
I have tried the following, but it breaks the ckeditor (ckeditor doesn't show):
Just to clarify:
https://ckeditor.com/ckeditor-5/online-builder/
and on that page:
Now, the ckeditor was showing when linking directly to the ckeditor on the ckeditor website:
But using the custom build, no ckeditor and no errors. Just a text area...
Also, the text area input has a class for ck ck-editor__main, yet no ckeditor is shown...
Are there any errors shown in your browser's console when you use your custom CKEditor build? I'm wondering specifically if there is actually a
ClassicEditor
object and if it has acreate
method available?If not, then this would be a question you'll need to ask the CKEditor support folks since I don't know how their custom builds work I'm afraid.
Allan
Hi Allan
Yes there is a ClassicEditor object, but it appears to be handled differently in the custom build. In the custom build there is:
Whereas in the CDN build as at https://cdn.ckeditor.com/ckeditor5/15.0.0/classic/ckeditor.js there is:
Otherwise could you suggest how I can customise the toolbar buttons with the CDN build??
OK, I got a custom build working using ckeditor v4 from https://ckeditor.com/cke4/builder
and used editor.ckeditor4.js at https://editor.datatables.net/plug-ins/field-type/editor.ckeditor
This works no problem, for example using the complete set of buttons. So now I should just be able to create another custom build using v4 to suit my needs.
Allan, you may want to look again at the editor.ckeditor5.js to work with v5 custom builds...
Peter
Yes, there appears to be a create method in v5 custom build, e.g.:
Thanks for the feedback. It seems really odd that the CDN build would expose CKEditor in a different manner from a custom build. We've only tested it with the CDN build which is why we didn't catch this before. Thanks for letting me know - we'll look into it.
Allan
Great! BTW, I will stick with ckeditor v4 until v5 catches up with some missing functionality that is in v4, e.g. the ability to select a ordered list and change from numeric to alpha which I need for my project.