RX dynamic snippet code error

Hi,

We are having some issues when trying to add javascript code to a dynamic snippet which is then included in a page.

The code I am trying to add is:

<script type='text/javascript' src='http://www.telecomtv.com/embed/swfobject.js'> </script>
<div id='embedplayer'></div>
<script type='text/javascript'> var so = new SWFObject('http://www.telecomtv.com/embed/player.swf','mpl','718','423','9');so.addParam('allowscriptaccess','always');so.addParam('allowfullscreen','true');so.addParam('wmode','transparent');so.addParam('flashvars','file=decisive/live-sites/www.telecomtv.com/low/TTV_News_Special_Report_13_04_12_Titanic&volume=100&autostart=false&streamer=rtmpt://mydeo.fcod.llnwd.net/a584/d1&type=video&image=http://video.telecomtv.com/web2/ugc/thumb/TTV_News_Special_Report_13_04_12_Titanic_large.jpg');so.write('embedplayer'); </script>

If I place the above code into a simple HTML page it plays the video just fine.

But when I preview the page in Rhythmyx the source code has been changed to:


<div rxscripttagmarker="true" src="http://www.telecomtv.com/embed/swfobject.js" type="text/javascript"><!--@@__8SCR@@__8SCR--></div><br /><br /> <div id="embedplayer"></div><p /><div rxscripttagmarker="true" type="text/javascript"><!--@@__8SCRvar so = new SWFObject('http://www.telecomtv.com/embed/player.swf','mpl','718','423','9');so.addParam('allowscriptaccess','always');so.addParam('allowfullscreen','true');so.addParam('wmode','transparent');so.addParam('flashvars','file=decisive/live-sites/www.telecomtv.com/low/TTV_News_Special_Report_13_04_12_Titanic&volume=100&autostart=false&streamer=rtmpt://mydeo.fcod.llnwd.net/a584/d1&type=video&image=http://video.telecomtv.com/web2/ugc/thumb/TTV_News_Special_Report_13_04_12_Titanic_large.jpg');so.write('embedplayer');@@__8SCR--></div>

I can preview OK in Firefox but this will not work in IE7/8.

Any reason for this? I am adding to code to a dynamic snippet basic textarea so I assume that this is not caused by Ephox.

Thanks

Chris

Chris,

Are there any Field Transforms set on this field? Seems like you may have the sys_EditLiveFormEncode field transformer set.

Hi Riley,

I forgot to add that we are using version 6.7

I’ve hada look at the template and the content type and the field in question is:

local
sys_textarea
text
No control properties
No binding encoding
No ‘field data properties’ or ‘namespaces’ checkboxes have been checked

The template code looks like this (I didn’t write this!):


#macro (codeitem $fieldname $slotname)
	#set ($fieldtext=$sys.item.getProperty("rx:$fieldname").String)
	#set ($start = '\x5bslot')
	#set ($end = '\x5d')
	
	#initslot($slotname "sys_authtype=0")
	#set($count = 2)
	#if($sys.currentslot.slot && $sys.currentslot.relresults.size() > 0)
     #foreach($relresult in $sys.currentslot.relresults )
	  #set ($resulttext = "#slotItem($relresult)")
	  #set ($fieldtext = $fieldtext.replaceAll("$start $count$end",$resulttext))
	  #set ($count = $tools.math.add($count,1))
	 #end
	#end$fieldtext#end
#macro(field_if_not_set $field $instead)#set($fv = $sys.item.getProperty($field).String)#if(!($fv && $fv!=""))$instead#end#end


#codeitem("body_code" "Code_Inline")


Chris,

can you provide the macro code for #slotItem ?

Macro code displayed below:


## slot_page macro displays the content of a paged slot, with parameters, with text specified for before and after each slot's content, 
## and with header and footer text. The header and footer are omitted if the contents of the slot is empty. 
## Note, $sys.pagecount must be specified as one of the binding variables in the Template; otherwise additional pages may not be published.  
## For example, $sys.pagecount=$rx.paginate.slotContentPageCount($sys.assemblyItem,$slotname,$pagesize,$sys.params)

#macro(slot_page $slotname $header $before $after $footer $params $itemsPerPage $pageNumber)##
   #initslot_page($slotname $params $itemsPerPage $pageNumber)
   #if($sys.currentslot.slot && $sys.currentslot.relresults.size() > 0)
      $header
      #foreach($relresult in $sys.currentslot.relresults )
          $before
          #slotItem($relresult)
          $after
      #end
      $footer
   #end  
#end


#macro(slotItem $relresult)##
#set($slotname = $sys.currentslot.slotname)##
#__startAaSnippetDiv($relresult $slotname)##
#__addAaSnippetImg($relresult $slotname)##
#set($body = "$rx.doc.extractBody($relresult)")##
$body##
#__endAaSnippetDiv()##
#end