Tuesday 19 February 2008 9:34:33 pm - 19 replies
I am trying to embed a YouTube object using Custom Tags. Everything goes ok but the object and embed tags gets removed by ez engine;I think. Here is my tpl which is based on the YouTube Plugin
<div class="youtube">
{literal}<object {/literal}width="{$width}" height="{$height}"{literal}>{/literal}{literal}<param name="movie" value="{/literal}{$movie_url}{literal}"></param><param name="wmode" value="transparent"></param><embed src="{/literal}{$movie_url}" type="application/x-shockwave-flash" wmode="transparent" width="{$width}" height="{$height}"{literal}></embed></object>{/literal}
</div>
Here is what my browser gets which is not enough to display the video
<div class="youtube"> <param value="http://www.youtube.com/v/sftTdJrlP7o"></param><param value="transparent"></param> </div>
What is the problem? I am using eZ 3.9.2
Modified on Tuesday 19 February 2008 9:35:38 pm by Softriva .com
Tuesday 19 February 2008 10:33:37 pm
hi,
in first, i think You will not use "{literal}" in its true place, in general literal is used when we want to introduce javascrip in language template (to avoid ambiguity between "{" of javascript and "{" of ez)
reference :
http://ez.no/doc/ez_publish/techn...late_functions/miscellaneous/literal
try this code :
<div class="youtube">
<object width="{$width}" height="{$height}">
<param name="movie" value="{$movie_url}"></param>
<param name="wmode" value="transparent"></param>
<embed src="{$movie_url}" type="application/x-shockwave-flash" wmode="transparent" width="{$width}" height="{$height}"></embed>
</object>
</div>
i hope this work.
tks
Abdelkader.
Wednesday 20 February 2008 1:39:50 pm
I give you my settings :
I create the custom tag "video" :
My content.ini.append.php
<?php /* #?ini charset="utf-8"? [CustomTagSettings] AvailableCustomTags[]=video IsInline[video]=true [video] CustomAttributes[]=width CustomAttributes[]=height CustomAttributesDefaults[width]=400 CustomAttributesDefaults[height]=316 */ ?>
design/<site_access>/override/templates/content/datatype/view/ezxmltags/video.tpl
<span class="video">
<object width="{$width}" height="{$height}" type="application/x-shockwave-flash" data="{$content}">
<param name="movie" value="{$content}"></param>
<param name="allowfullscreen" value="true"></param>
</object>
</span>
Good luck.
Wednesday 20 February 2008 1:50:42 pm
> design/<site_design>/override/templates/content/datatype/view/ezxmltags/video.tpl
This won't work in 4.0, unless its actually a override ( defined in override.ini* ), so needs to be:
design/<site_design>/templates/content/datatype/view/ezxmltags/video.tpl
Or if you use your own design extension:
extension/<my_extension>/design/<site_design>/templates/content/datatype/view/ezxmltags/video.tpl
Modified on Wednesday 20 February 2008 1:51:00 pm by André R
Wednesday 20 February 2008 3:04:31 pm
Mine is in
design/<site_design>/templates/content/datatype/view/ezxmltags/youtube.tpl
and I am running 3.9.2. My original problem is that the tag object and embed get stripped off when the template is parsed. Please see my original post.
Modified on Wednesday 20 February 2008 3:04:42 pm by Softriva .com
Wednesday 20 February 2008 7:59:01 pm
My solution works from 3.9.3 to 3.4.0:
In content.ini set:
[literal] AvailableClasses[] AvailableClasses[]=html
Now create an object with an xml field for example an article, create a literal html block in the xml field by clicking the tab "insert literal text" form OE and choose class>html. Then copy and paste the embed code of your YouTube object in the literal block and publish!
It also works for embedding other objects like google maps etc.
Thursday 28 August 2008 11:16:17 pm
Same problem here in ez 4.0.0 with both the custom tags and the object html tag in the ezxml custom tag template.
I've tried, too, the solution from Sandra using the 'literal' ezxml tag and the 'html' class, to no avail, even if the default template does actually detect the classification
---------
1 content/datatype/view/ezxmltags/literal.tpl <No override> design/standard/templates/content/datatype/view/ezxmltags/literal.tpl
---------
(native) template code :
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{section show=ne( $classification, 'html' )}
<pre{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>{$content|wash(xhtml)}</pre>
{section-else}
{$content}
{/section}
I really do think that something is messed up, somehow, maybe a "collision" between the 'object' ezxml tag and the 'object' html tag in the content/datatype/view/ezxmltags template, be it the 'literal' tag template or a 'custom' tag template.
Thursday 28 August 2008 11:33:24 pm
Some additional info : when in the 'literal' tag template, the tag value is unaltered.
Given the following template code :
{section show=ne( $classification, 'html' )}
<h1>this is not html</h1>
<pre{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>{$content|wash(xhtml)}</pre>
{section-else}
<h1>this is html</h1>
{$content}
{/section}
<h1>{$classification}</h1>
<pre>{$content|wash()}</pre>
and the following 'literal' tag value :
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/-XzNIUt1dBQ&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/-XzNIUt1dBQ&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
Here's the output :
<h1>this is html</h1> <param value="http://www.youtube.com/v/-XzNIUt1dBQ&hl=en&fs=1"></param><param value="true"></param> <h1>html</h1> <pre><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/-XzNIUt1dBQ&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/-XzNIUt1dBQ&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object> </pre>
So :
1) the $content DOES contain the plain value of the 'literal' tag
2) the 'html' $classification value IS there
I've performed an additional test, using the set-block operator to output the value of $content in a template variable, then display it in a <pre> tag :
<h2>Using set-block</h2>
{set-block variable=grabcontent}
{$content}
{/set-block}
<pre>{$grabcontent}</pre>
The result is the same, the 'object' and 'embed' HTML tags just vanished :
<h2>Using set-block</h2><pre><param value="http://www.youtube.com/v/-XzNIUt1dBQ&hl=en&fs=1"></param><param value="true"></param> </pre
Friday 29 August 2008 1:47:00 pm
For all people having this kind of problem of the <object> and <embed> html tags disappearing, try to look for ANY template override or redefinition of content/datatype/view/ezxmltext.tpl for instance in your design extensions.
If you're using the xmlwash operator / extension, don't look further, it's the culprit.
This extension redefines the ezxmltext.tpl :
{if is_set($maxlength)}
{$attribute.content.output.output_text|shorten($maxlength)|xmlwash()}
{else}
{$attribute.content.output.output_text|xmlwash()}
{/if}
While it does its job to close unproperly closed html tags, it also delete the following html tags :
var $deleteTags = array( 'applet', 'base', 'basefont', 'bgsound', 'blink', 'body', 'embed', 'frame', 'frameset', 'head', 'html', 'ilayer', 'iframe', 'layer', 'link', 'meta', 'object', 'style', 'title', 'script', );
while not clearly claiming it in the documentation ...
Wednesday 29 October 2008 6:46:16 pm
Hi
Just an update on the solution using Literal Tags, which is great and I have used it for all sorts. But I recently discovered that it does not seem to work using the Online editor and IE7. If the code you cut and paste from YouTube, Google etc contains a "http://..." which it invariably does, ie in the online editor highlights this as a link and when you publish it there are extra <A> </A> tags around all your file references and so doesn't work.
Thursday 30 October 2008 8:41:22 am
Hi Richard,
it would be great if you post your message also here:
http://ez.no/developer/contribs/applications/ez_oe_mce
I think it's an issue that must be fixed before final release of OE 5
Thanks!
Saturday 24 January 2009 1:06:13 am
Have you had a look at
http://ez.no/developer/contribs/template_plugins/youtube_template_plugin
I used to use this on 3.6.x and it was fine. It is documented to work on 3.9 and from how it works I don't see why it should not work on 3.8
Friday 29 October 2010 4:21:49 pm
If you're using the xmlwash operator / extension, don't look further, it's the culprit.
That was it for me. The code thats washing out <embed> and <object> (but not "param"
is in extension/xmlwash/safehtml/safehtml.php at the top. it's also stripping all attributes with the name "name" (in the $attributes array). remove these and at least youtube will work again.
thanks!
*-pike
You must be logged in to post messages in this topic!