Hello all,
This is my first time posting on any sort of technology forum (relatively new to the professional development world) so please bear with me. I have scoured the forum and Google for an answer to my question but have not yet found any references to it. I am trying to figure out if it is possible to edit the editor to output class names instead of style attributes? I.E......
Current editor behavior:
<span style="background-color:red;"></span>
Desired editor behavior:
<span class="class_name"></span>
If this IS possible, is it also possible to add multiple class names to the same tag?
<span class="class1 class2 class3"></span>
I guess what I am really asking is....Is it possible to control how CKEditor renders tag attributes? I would like to thank anyone for their help in this matter ahead of time.
Chris
This is my first time posting on any sort of technology forum (relatively new to the professional development world) so please bear with me. I have scoured the forum and Google for an answer to my question but have not yet found any references to it. I am trying to figure out if it is possible to edit the editor to output class names instead of style attributes? I.E......
Current editor behavior:
<span style="background-color:red;"></span>
Desired editor behavior:
<span class="class_name"></span>
If this IS possible, is it also possible to add multiple class names to the same tag?
<span class="class1 class2 class3"></span>
I guess what I am really asking is....Is it possible to control how CKEditor renders tag attributes? I would like to thank anyone for their help in this matter ahead of time.
Chris
Re: Change style to class
try something like this
CKEDITOR.config.contentsCss = '/ckestyle.css';
at the config.js file
look for more at, maybe it can help you
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
Re: Change style to class
E.g.
CKEDITOR.addStylesSet( 'my_styles2',
[
{ name : 'Style 1', element : 'span', attributes : { 'class' : 'my_style my_style2' } },
{ name : 'Style 2', element : 'span', attributes : { 'class' : 'my_style3' } }
]);
CKEDITOR.config.stylesCombo_stylesSet = 'my_styles2';