Hi,
Some strange behavior I can't figure out: I'm activating the editor by calling 'ckeditor()' on the 'div' element where I want the editting to take place. The div initially contains an 'img' element, and also an 'a' and some text. When I try to activate the editor by calling 'ckeditor()' on the 'div', the text and the 'a' element remain, but the 'img' element is removed somehow even before I type something in the 'div'. Additionally - if I don't call the 'ckeditor()' - the 'div' is still editable, the toolbar does not appear but keyboard shortcuts do work (such as ctrl-b for 'bold') - and the image does not dissapear. It is as if the appearence of the toolbar causes the removal of the 'img' element and only of this element.
Any ideas?
Thanks !
Elior.
I found it !
after hours... the ckeditor() checks that only elements which are in the 'allowedContent' list are possible. So, when calling ckeditor() I added the 'img' item:
var ckeditor = $div.ckeditor({ allowedContent: 'img[alt,!src]{width,height,float}' }, function () { ... } );
This means that I allow the 'img' element with optional 'alt' attribute, required 'src' attribute, and allowed 'widht','height', and 'float' in the element's style.
See this link: http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
Elior.