stevensf
stevensf

Reputation: 31

CkEditor - 2 styles at the same time...?

Is there a way to add more than one class with ckeditor style list ?

I have two class in my ckeditor.style.js

{ name: 'Important (petit)', element: 'p', attributes: { 'class': 'important-small' } },
{ name: 'Capitalize', element: 'p', attributes: { 'class': 'caps' } },

I want, if you select via the style list the two classes this result :

<p class="important-small caps">my test</p>

But if I select one class and another one just after, the first class disappear, replaced by the second

Upvotes: 1

Views: 315

Answers (1)

Antares42
Antares42

Reputation: 1436

You are not the first to encounter this problem.

However, CKEditor does not currently support setting two styles on the same element from their dropdown. Have a look at this or this ticket in their tracker.

If adding the classes in the source view is not an option you may have to write your own plugin (like this SO user is doing for colors.

Upvotes: 1

Related Questions