Danila Alpatov
Danila Alpatov

Reputation: 872

CkEditor — user-definable styles

Is there is any way to create, name and save style directly from editor? In my case, content-managers would not edit css file or make any other "technical things", they just want to use styles like in MS Word: select text, style it with color, font and size and save that set of styling as custom-named style for future use.

I googled very hard but with no success.

Upvotes: 0

Views: 38

Answers (1)

Atzmon
Atzmon

Reputation: 1308

You'll need to write some code to achieve this:

  1. Create a ckeditor plugin that takes the selected HTML (using editor.getSelection), extracts its style(s), asks for a style name, and finally (if no style with that name exists) saves it to your database. You can expand this with the ability to modify an existing style etc.
  2. When loading your ckeditor, populate the styles drop-down with the styles in your database.

Upvotes: 2

Related Questions