Hello guys and girls,
I'm using the CKEditor 4.2.2 to load an xml-file, wich is parsed before it gets to CKEditor, that means I have sections in my xml, and every secteion for itself is sent to CKEditor.
So I can edit every section for it self via CKEditor, now I have the problem, that CKEditor removes all <hidden var="@mask" default="content/main/search.xml" />-Tags and other unique xml-tags and if its thats not bad enough ist also automaticly adding a p-tag when i click in the textarea of the editor to write something.
How can I tell CKEditor to send all data and tags he finds directly without any changes to the textarea and how can I tell him NOT to add automaticly any html-tags?
If you can at least help me to solve the 2. Problem then it will be already awesome, couse before we where using CKEditor 3.5 and the problem with disappearing of xml-tags was not in the version 3.5. So i'm searching also for the possibility to forbid the CKEditor3.5 adding html-tags automaticly (as long the user not fires an event to create a table or something like this).
Regards Basti890
First of all, as I mentioned
First of all, as I mentioned under the ticket you reported - CKEditor is not an XML editor - http://dev.ckeditor.com/ticket/10998#comment:3
Second thing - check out the Advanced Content Filter guide - http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter. It is possible to disable it.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
solved autoadding of p-tags
Thanks for the tips i already succed in telling CKEditor NOT to add automaticly a p-tag by adding the following linnes to my config.js:
config.autoParagraph = false;
config.enterMode = CKEDITOR.ENTER_BR;
when i solved the other Problems i will report my solution for other users.
CKEditor can in this case operate with my .xml cause a servlet only directs parts oft it (sections) to the editor and the sections contain xhtml-content, so when i manage it, that CKEditor can handle xhtml, then it schould work fine for me.
I searched a bit more, it seems CKEditor is trying to auto-fill my xhtml-content so I just need to tell him to redirect the loaded content 1:1.
BTW: CKEditor is an awesome tool and you can be very proud of it.
EDIT: myactual config is:
config.autoParagraph = false;
config.enterMode = CKEDITOR.ENTER_BR;
config.allowedContent = true;
config.entities = false;
CKEDITOR.filter.disabled = true;
My source code and what CKEditor is doing with it:
Source:
<editor id="searchmask">
<source uri="searchInput:{id}" />
<target type="servlet" name="MCRSearchServlet" method="post" format="xml" />
<components root="root" var="/query">
<panel id="root">
<hidden var="@mask" default="content/main/search.xml" />
<hidden var="@maxResults" default="0" />
<hidden var="@numPerPage" default="10" />
<hidden var="conditions/@format" default="xml" />
<hidden var="conditions/boolean/@operator" default="and" />
<!-- Search only for object type document -->
<hidden var="conditions/boolean/condition1/@field" default="objectType" />
<hidden var="conditions/boolean/condition1/@operator" default="=" />
<hidden var="conditions/boolean/condition1/@value" default="document" />
<!-- Search in field "name" with operator "contains" -->
<hidden var="conditions/boolean/condition2/@field" default="allMeta,content" />
<hidden var="conditions/boolean/condition2/@operator" default="contains" />
<cell row="1" col="1" anchor="EAST">
<text i18n="editor.search.inall.label" />
</cell>
<cell row="1" col="2" anchor="WEST" var="conditions/boolean/condition2/@value">
<textfield width="40" />
</cell>
<cell row="1" col="3" colspan="2" anchor="EAST">
<submitButton i18n="editor.search.search" width="150px" />
</cell>
</panel>
</components>
</editor>
CKEditor:
<editor id="searchmask">
<source uri="searchInput:{id}" />
<target format="xml" method="post" name="MCRSearchServlet" type="servlet">
<components root="root" var="/query">
<panel id="root">
<hidden default="content/main/search.xml" var="@mask">
<hidden default="0" var="@maxResults">
<hidden default="10" var="@numPerPage">
<hidden default="xml" var="conditions/@format">
<hidden default="and" var="conditions/boolean/@operator">
<!-- Search only for object type document -->
<hidden default="objectType" var="conditions/boolean/condition1/@field">
<hidden default="=" var="conditions/boolean/condition1/@operator">
<hidden default="document" var="conditions/boolean/condition1/@value">
<!-- Search in field "name" with operator "contains" -->
<hidden default="allMeta,content" var="conditions/boolean/condition2/@field">
<hidden default="contains" var="conditions/boolean/condition2/@operator">
<cell anchor="EAST" col="1" row="1">
<text i18n="editor.search.inall.label" />
</cell>
<cell anchor="WEST" col="2" row="1" var="conditions/boolean/condition2/@value">
<textfield width="40" />
</cell>
<cell anchor="EAST" col="3" colspan="2" row="1">
<submitbutton i18n="editor.search.search" width="150px" />
</cell>
</hidden>
</hidden>
</hidden>
</hidden>
</hidden>
</hidden>
</hidden>
</hidden>
</hidden>
</hidden>
</panel>
</components>
</target>
</editor>
I hope any1 one can help me or give me a hint how i solve this Hirarchie mixing :O
Check out the CKEDITOR.dtd
Check out the CKEDITOR.dtd object. You can add missing elements there.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Thanks man this works for me.
Thanks man this works for me.
I just added the following line to my config.js
CKEDITOR.dtd.$empty= { area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,hidden:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,target:1,text:1,wbr:1 };
and now ist not anymore mixing up my hirachie it seems to work now exactly like i want / need.
I uploaded my config file that everyone who need some inspiration can have a look at it.
Attachments:
Chaning of standard behaivior
Hello,
I just talked with my supervisor and he wnats to have a changed standard behavior, the problem was CKEditor didn't knew that the hidden and some othe elements can be empty (without childs), so he was changing them, but because this situation will often it will be better to change the sndard behaivior if CKEdtior hits an element wich it doesn't know.
That means normal html-content can be edited automaticly by the editor but when an element shows up, which the editor doesn't know he shall just give the input 1:1 to editor wondow without any changements.
Is it possible to change the Editor's standard behavior?
[solved] with maxified Version of CKEditor
Hey ist seems solved,
I just set the dataprocessor to null, and nothing is ever changed :P.
This is OK for me cause the User knows in this case what to do.
here my config:
config.language = 'de';
config.autoParagraph = false;
config.enterMode = CKEDITOR.ENTER_BR;
config.allowedContent = true;
CKEDITOR.dataProcessor = null;
CKEDITOR.config.flashAddEmbedTag = false;
Edit: It works fine with the maximized version but CKEDITOR.dataProcessor = null; doesn#t work in the minified version, for that i created a bug-report.
[Problem] CKEditor is changing large and lowercase
Hi,
After I talked directly to CKEditor-developer I noticed, that there are always some filters that can't be turned of.
So i decided to modify CKEDITOR.dtd and added my tags I need.
But now I noticed, that CKEditor is changing large and lowercase of <submitButton .../> to <submitbutton ... />.
I need to turn that of: how do I doo it?
Here my config.js:
EDIT: i got some more problems:
1. i have some tags like <cell> which CAN be empty but it also can contain children
2. like I wrote before some filters are chaning submitButton to submitbutton, any changing of the names of nodes must to be turned of, for me
CKEditor is not for editing
CKEditor is not for editing XML. There are limitations spread across entire code base. Careful CKEDITOR.dtd object extension may help with some of them but that will never make CKEditor an XML editor.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
And what with the xml-Plugin?
Thanks for the advice, i found earlier the XML-Plugin http://ckeditor.com/addon/xml but it seesm not to work.
I added it and I added config.extraPlugins = 'xml'; to my config.js, but nothing changed in the behavior (even if I run only the plugin and do no changes to dtd).
That plugin only provides a
That plugin only provides a simple API to parse XML documents, it's designed to be used with http://ckeditor.com/addon/ajax that it's also a plugin to provide an API that allows for example to load templates defined as xml files (FCKeditor style) instead of js (CKEditor default)
As they have been telling you, CKEditor is not designed to edit XML, so you'll have a lot of issues if you try to use it for something that it's not planned at all.
Now using protectedSource
After a small Dialog with an other developer, he gave me the hint to try http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-protectedSource
I just added all custom-tags I found, but probably CKEDITRO is now adding a <br /> in front of my source, if i delete and save, everything is fine.
But if i don't delete it all < are replaced by < and > by >.
Why is it that doing, when i have config.autoParagraph = false; set in my config?
part of my config.js: