2

I want to integrate some bootstrap classes to my ckeditor profile:

{ name : 'Button Large' , element : 'a', attributes : { 'class' : 'btn-lg' } },
{ name : 'Button Primary' , element : 'a', attributes : { 'class' : 'btn-primary' } },

but the problem is those styles cant be combined. If I want a button which is btn-primary AND btn-lg I would have to create a third style:

{ name : 'Button Large Primary' , element : 'a', attributes : { 'class' : 'btn-lg btn-primary' } },

which obviously is quite redundant for many buttons and not necessary. So how can you do this?

Using CKeditor 4.4.3

Alex
  • 9,911
  • 5
  • 33
  • 52
  • OK, it took me way too long to understand what you're trying to do. You want to add Bootstrap classes into the CKEditor Styles dropdown and then combine them on elements in the document you're editing. Right? Bad news is, I don't think the Styles dropdown allows you to do that, as it's not multiselect. Only one style can be selected per block/object element, and maybe combined with inline element styles. You cannot have two styles on one ```` tag. This is by design. – Antares42 Nov 02 '15 at 20:50

1 Answers1

3

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.

Community
  • 1
  • 1
Antares42
  • 1,406
  • 1
  • 15
  • 45