I am trying to determine how to programmatically insert CSS and/or HTML content around the selected block in my editor. I'm running the latest release of 4 and cannot seem to find much information about external calls into CKEDITOR that doesn't destroy the selected content.
Any help is greatly appreciated.
It's very difficult to come
It's very difficult to come across as a useful tool if your forum responsiveness is this bad.
Hi Darkfrog,
Hi Darkfrog,
I'm afraid you are getting it a bit wrong here. This is the *community* forum, and CKEditor is an Open Source tool. This means we develop it and release completely for free, for anyone to use. At the same time it's simply impossible for us to answer every single question in the forums, though we would of course very much want to do this. Instead of helping individuals here it's a much better investment of our resources to fix editor bugs and innovate further as this is something that the whole community will benefit from much more.
You complain about forum responsiveness from the community... Well, it is up to other users to answer your question. Have you tried helping anyone here before expecting anyone to help you? Did you look into the documentation and API? Why don't you try going to the API docs, search "insert" and you will get a few hints from search auto completion...
By the way, if you are not interested in the Open Source model, with all its advantages and disadvantages, you can always simply pay for a commercial license and get enterprise-level support. This is however the sort of choice that you need to make by yourself.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Hi Anna,
Hi Anna,
I understand the open-source model, I actually run several open-source projects myself, but all the innovation in the world doesn't really matter if people cannot get their questions answered effectively. It is a common mistake of projects to think that their time should only be invested in making their system better when the project continues to grow creating greater and greater gaps that leave people behind that cannot find a way to solve their needs.
I have spent days pouring through the API docs and though it is fairly complete in one sense, it lacks explanation for many of the functions, fields, and events so it involves a lot of trial-and-error to figure out what the stuff actually does or digging through source code.
As for responding to other people's questions I am just now to the point of feeling capable of doing so. In fact, I'll go one better and answer my own question. Let me clarify here that I was not able to find this solution through the forums or even the docs, but rather through digging into the plugins on github.
A few examples for stylization:
// Define a style to set the font size
// Define a style to set the CSS class
In order to define the style on the selection:
In order to remove the style from the selection:
To check the status of a style on the current selection is a bit more complex:
If someone could have pointed me this direction a week ago I would have gotten here significantly faster, but obviously you were too busy adding new stuff to the editor. :)