fontSize in Toolbar of ckeditor
fontSize in Toolbar of ckeditor
Hi,
I managed to get ckeditor to work and show BulletedList, Undo and Redo in the toolbar. Bute fontSize is not working:
"type": "ckeditorClassic",
"opts": {
"toolbar" : ['fontsize','BulletedList', 'Undo', 'Redo'],
},
Console shows:
ckeditor.js:6 toolbarview-item-unavailable {item: 'fontSize'}
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-toolbarview-item-unavailable
I read the notes but don't now how to get this plugin and how to add it. Can you give me any support on this?
Every help will be highly appreciated.
Thank you very much.
Answers
Hi,
Have you tried the method mentioned in the CKEditor docs to list all toolbar options available?
It could be that something else just needs to be loaded in, or perhaps it is called
fontSize
(case sensitive).Allan
Hi allan,
thank you very much for your reply. I tried several lower / uppercase variants as fontsize, FontSize, fontSize, unfortunately, it doesnt work.
I've seen
Array.from( editor.ui.componentFactory.names() );
but actually don't know where to use it...
Uncaught TypeError: Cannot read properties of undefined (reading 'componentFactory')
I'm using CKEditor v5
Running it on their demo page (just in the console,
editor
is a global variable there), yields:fontSize
is the one suggested there.You could try it in line 56 in the plugin (
conf._ckeditor = editor;
). You might need an empty toolbar to see what the options are without an error though.Allan
Hi allan,
thank you very much, I managed to get the list, but fontSize is missing. I now managed to "bend" the 'heading' styles to my needs.
Maybe I will get back to this later with more time.
thank you very much
['accessibilityHelp', 'selectAll', 'undo', 'redo', 'bold', 'italic', 'blockQuote', 'link', 'ckfinder', 'uploadImage', 'imageUpload', 'heading', 'imageTextAlternative', 'insertImage', 'imageInsert', 'toggleImageCaption', 'imageStyle:inline', 'imageStyle:alignLeft', 'imageStyle:alignRight', 'imageStyle:alignCenter', 'imageStyle:alignBlockLeft', 'imageStyle:alignBlockRight', 'imageStyle:block', 'imageStyle:side', 'imageStyle:wrapText', 'imageStyle:breakText', 'indent', 'outdent', 'numberedList', 'bulletedList', 'mediaEmbed', 'insertTable', 'tableColumn', 'tableRow', 'mergeTableCells']
That would certainly explain the error message. I'm afraid I don't know enough about CKEditor to suggest why it would be missing though. Possibly a configuration option in the CKEditor build? You might need to reach out to their support.
Allan