So how would i rewrite an element's tag?
I don't want to learn regex to replace html elements.
The best example i've found is the placeholder, but it uses regex to replace text ..
I have some custom elements that look like this:
<idt:templatefield contenteditable="false" error="" expression="((INNOMATE.Base.Employee)((INNOMATE.Data.Serialization.MappedObjectReference)activity0.Arguments["bdcc4f8c-3dc1-4d94-9cc1-a9892dacfd46"]).GetRealObject()).FirstName" isformattable="false" label="Medarbejder → First name" longlabel="MUS 2011 → Medarbejder → First name" style="background-color: #ffff00;" type="String" xmlns:idt="http://www.innomate.com/Diesel"></idt:templatefield>
i can catch them with this in datafilter:
elements: { 'idt:templatefield': function (element) { if (element.attributes && element.attributes['label']) { // tried alot of different things here, but no luck so far.. element.attributes['style'] = templateBGcss; element.attributes['contenteditable'] = 'false'; element.innerHTML = element.attributes['label']; return element; //return CKEDITOR.plugins.placeholder.addFieldFromExisting(editor, element); } }, }
But how do i rewrite the tag name? ..or copy the attributes to a new tagname?
I want to use the label="Medarbejder → First name" attribute as the name for my placeholder.. so it would look something like what the placeholder plugin does. (sorry, can't use bg color here )
[[Medarbejder → First name]]
I'm confused by the inconsistent JSON usage.. and the CKEDITOR.dom.element documentation lists alot of methods that arent allowed on this particular element ..
I can't use .setText() or .setHtml() or .setAttributes() ..
Help!