Please add a snippets forum where people can post and find code to enhance the default editor. (I guess one can also sign up and edit the docs website, but more effort as judged by the very slim docs there and maybe not the best place for random enhancements and hacks anyway.)
As-is, with so little documentation, no simple configuration settings or widgets for common requirements, and waiting ages (or forever) for an answer on the forum, it is a nightmare trying to figure out how to do basic things like:
-add various custom buttons: insert text, add quotes around a word, insert class, etc. (eventually add a built-in dropdown and different custom button types included),
-add your own styles/classes (I know you can but where is it explained?),
-use html 4 style tags (eventually add a one-line config option),
-stop indenting the html within tags (eventually add a one-line config option),
-etc., etc.
Can you imagine how much wasted time would be saved by all concerned?
For example, it has taken me days and tons of searching just to set some basic things and I still don't know how to insert text at the cursor via a button or dropdown list, so still cannot use the editor onsite. (Does someone have code for that very common task?) Or how to apply some of my website classes to the displayed html in the editor. (Anyone?) Or how to add my own styles to the styles dropdown. (Where is that info?)
So, please add a snippets forum where people can post and find code easily to enhance the editor. Good for everyone.
As-is, with so little documentation, no simple configuration settings or widgets for common requirements, and waiting ages (or forever) for an answer on the forum, it is a nightmare trying to figure out how to do basic things like:
-add various custom buttons: insert text, add quotes around a word, insert class, etc. (eventually add a built-in dropdown and different custom button types included),
-add your own styles/classes (I know you can but where is it explained?),
-use html 4 style tags (eventually add a one-line config option),
-stop indenting the html within tags (eventually add a one-line config option),
-etc., etc.
Can you imagine how much wasted time would be saved by all concerned?
For example, it has taken me days and tons of searching just to set some basic things and I still don't know how to insert text at the cursor via a button or dropdown list, so still cannot use the editor onsite. (Does someone have code for that very common task?) Or how to apply some of my website classes to the displayed html in the editor. (Anyone?) Or how to add my own styles to the styles dropdown. (Where is that info?)
So, please add a snippets forum where people can post and find code easily to enhance the editor. Good for everyone.

Re: please add a snippets forum to post and find code easily
Re: please add a snippets forum to post and find code easily
1) create an named array of the styles you want
2) in the config options for you CKEDITOR add in a stylesCombo_stylesSet
CKEDITOR.addStylesSet('MAstyle',[ {name:'h1',element:'h1'}, {name:'h2',element:'h2'}, {name:'h3',element:'h3'} ]); CKEDITOR.config.toolbar_Minimal=[ ['Source','Bold','Italic','Underline'] ]; CKEDITOR.replace( '".$id."', { stylesCombo_stylesSet: 'MAstyle' }); </script>Re: please add a snippets forum to post and find code easily
I follow documentation, examples and forum but custom styles for combos didn't work for me.
This is my code:
<script language="JavaScript" src="./editor/ckeditor/ckeditor.js"></script> <script language="JavaScript"> CKEDITOR.addStylesSet('miei_stili',[{ name: 'Immagine a sinistra' , element: 'img', attributes: { 'style': 'padding: 5px; margin-right: 5px; float:left;display:inline;border: 0px solid #000000;position:relative;' } } ,{ name: 'Immagine a destra' , element: 'img', attributes: { 'style': 'padding: 5px; margin-left: 5px; float:right;display:inline;border: 0px solid #000000;position:relative;' } } ,{ name: 'Immagine con bordo nero' , element: 'img', attributes: { 'style': 'border: 1px solid #000000;' } } ,{ name: 'Immagine senza bordo' , element: 'img', attributes: { 'style': 'border: 0px solid #000000;' } }]); CKEDITOR.replace( 'contenuto', { stylesCombo_stylesSet: 'miei_stili' }); </script>Help please!
Thanks.
Re: please add a snippets forum to post and find code easily
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">CKEditor</a>.</p></textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.addStylesSet('miei_stili',[{ name: 'Immagine a sinistra' , element: 'img', attributes: { 'style': 'padding: 5px; margin-right: 5px; float:left;display:inline;border: 0px solid #000000;position:relative;' } } ,{ name: 'Immagine a destra' , element: 'img', attributes: { 'style': 'padding: 5px; margin-left: 5px; float:right;display:inline;border: 0px solid #000000;position:relative;' } } ,{ name: 'Immagine con bordo nero' , element: 'img', attributes: { 'style': 'border: 1px solid #000000;' } } ,{ name: 'Immagine senza bordo' , element: 'img', attributes: { 'style': 'border: 0px solid #000000;' } }]); CKEDITOR.replace( 'editor1', { stylesCombo_stylesSet: 'miei_stili' }); //]]> </script>Re: please add a snippets forum to post and find code easily
$this->output = "CKEDITOR.addStylesSet('stili_editor',["; //builds styles from a php array $stili if (is_array($stili) and count($stili)!= 0) { foreach ($stili as $stile) { $this->output .= "{ name: '".$stile['nome']."' , element: 'div', attributes: { 'class': 'classEditor".$stile['id']."' } } ,"; } }