Ephox and inline template

The following HTML is added to an EditLive field when I attempt to add an inline template.

<div contenteditable=‘false’ class=‘rx_ephox_inlinevariant’ style=‘display: inline’> rxinlineslot=“105” sys_dependentvariantid=“1007” sys_dependentid=“595” sys_siteid=“315” sys_folderid="" inlinetype=“rxvariant”</div>

The template I’m attempting to add to the EditLive field previews fine.

What is going wrong?

I’ve actually had this happen due to multiple reasons. The two major ones that I’ve encountered during development are:

  1. When there is an ampersand in the display title (sending this as a tech support ticket)
  2. If you are trying to embed an editlive snippet and you haven’t surrounded the snippet code with divs…

Thank you, wrapping the snippet in a DIV fixed the issue.

Just for the record, templates that are inserted “inline” must be well formed XML. This means, amongst other things: the 5 XML special characters (< > ’ " & ) must be escaped, and there must be a single root node (in your case the <div> tag)

Is there any way to prevent the user from entering a not properly formated xml text? I guess this ties into my other question in regards to preventing the end user from entering certain characters?

http://forum.percussion.com/showthread.php?t=300

Will it work if you enclose for example some javascript in <![CDATA[ … ]]?

It should then be valid xml and not need escaping

I have a snippet that uses some javascript it all works fine when used in a page but when inserted in to ephox inline the search window just hangs with Your request is being processed. Please wait a moment…

I have enclosed the whole lot in <div> tags

I’ve successfully managed to insert Javascript code (just tested with alert(‘foo’):wink: in the editlive box (surround the actual code with CDATA), and it works on preview (ie. the javascript runs), however on publish, this code doesn’t run…never bothered to figure out precisely why as I got caught up in other matters. Would be curious to know if anyone else has tried this (or has managed to disable this “feature”)