Embed or Iframe Youtube in EditLive

Hi,

I have set up a new inline template so that editors can add Youtube (or other) embedded content via the Editlive field by inserting an inline variant (RX 7.2 btw).

The RX code looks like this:

#if($allowfullscreen == "1")
		#set($screenallow = "allowfullscreen")
	#end	
	<iframe width="$vidheight" height="$vidheight" src="$youtubeUrl" frameborder="0"></iframe>	
	
	
    <object width="$vidwidth" height="$vidheight">
		<param name="movie" value="//www.youtube.com/v/$YouTubeID?hl=en_US&version=3"></param>
		#if($allowfullscreen == "1")
		<param name="allowFullScreen" value="true"></param>
		#end
		<param name="allowscriptaccess" value="always"></param>
		<embed src="//www.youtube.com/v/$YouTubeID?hl=en_US&version=3" type="application/x-shockwave-flash" width="$vidwidth" height="$vidheight" allowscriptaccess="always" #if($allowfullscreen == "1") allowfullscreen="true" #end></embed>
</object>	

I tried with both the Iframe and Embed as I was not getting results with the iframe.

When previewing a Video content type with this template it works fine and you can see the video BUT when it is added to the Editlive field within a page and previewed, the code is removed by RX and neither the video or the Youtube code is visible.

What’s the problem here?

Thanks

Chris

I’ve simplified the template so it only shows the iframe:

<iframe width="$vidwidth" height="$vidheight" src="$youtubeUrl" frameborder="0"></iframe>

It has worked occasionally but most of the time the <iframe> is stripped out as soon as I hit update.

There is a patch in QA that eliminates a good deal of the text processing that we used to do on Edit Live fields that caused this type of problem. Have you tried wrapping the iframe or object tag in a div? Ephox seems to want a container in some of these types of scenarios.

-n

[QUOTE=chrisclancy;20950]Hi,

I have set up a new inline template so that editors can add Youtube (or other) embedded content via the Editlive field by inserting an inline variant (RX 7.2 btw).

The RX code looks like this:

#if($allowfullscreen == "1")
		#set($screenallow = "allowfullscreen")
	#end	
	<iframe width="$vidheight" height="$vidheight" src="$youtubeUrl" frameborder="0"></iframe>	
	
	
    <object width="$vidwidth" height="$vidheight">
		<param name="movie" value="//www.youtube.com/v/$YouTubeID?hl=en_US&version=3"></param>
		#if($allowfullscreen == "1")
		<param name="allowFullScreen" value="true"></param>
		#end
		<param name="allowscriptaccess" value="always"></param>
		<embed src="//www.youtube.com/v/$YouTubeID?hl=en_US&version=3" type="application/x-shockwave-flash" width="$vidwidth" height="$vidheight" allowscriptaccess="always" #if($allowfullscreen == "1") allowfullscreen="true" #end></embed>
</object>	

I tried with both the Iframe and Embed as I was not getting results with the iframe.

When previewing a Video content type with this template it works fine and you can see the video BUT when it is added to the Editlive field within a page and previewed, the code is removed by RX and neither the video or the Youtube code is visible.

What’s the problem here?

Thanks

Chris[/QUOTE]

You can keep the WYSIWYG from stripping out the iframe by adding some dummy content in between the opening and closing iframe tags. A non-breaking space ( ) works.