In a template definition containing a hidden field, if the template is added to the editor and "Replace actual contents" is unchecked, the HTML rendered does not match the template content; specifically, the hidden fields are replaced with img tags. The template HTML is rendered correctly if "Replace actual contents" is left checked.
Example template:
When I click on the above template in the template plugin window and leave "Replace actual contents" checked, the editor contains the following HTML:
Now if I leave the above content in place (or delete it- it does not matter) and then add the template again with "Replace actual contents" unchecked, the follow HTML is appended to the editor:
I do not know if there are any other HTML elements that exhibit this behavior, but the hidden field is one. My guess is that the problem would apply to any element which is rendered as an image in the WYSIWYG view of CKEditor.
Example template:
CKEDITOR.addTemplates('default',
{
templates:
[
{
title: 'Test',
html: '<input name="HiddenField" type="hidden" value="Value" />'
+ '<input type="submit" value="Submit" />'
},
]
});When I click on the above template in the template plugin window and leave "Replace actual contents" checked, the editor contains the following HTML:
<p> <input name="HiddenField" type="hidden" value="Value" /> <input type="submit" value="Submit" /></p>
Now if I leave the above content in place (or delete it- it does not matter) and then add the template again with "Replace actual contents" unchecked, the follow HTML is appended to the editor:
<p> <img align="" alt="Unknown Object" src="../../../../../Content/Js/ckeditor/images/spacer.gif?t=A8LE4JO" /> <input type="submit" value="Submit" /></p>
I do not know if there are any other HTML elements that exhibit this behavior, but the hidden field is one. My guess is that the problem would apply to any element which is rendered as an image in the WYSIWYG view of CKEditor.

Re: Bug when adding template without replacing content
Re: Bug when adding template without replacing content
Re: Bug when adding template without replacing content