Author
|
Message
|
Softriva .com
|
Tuesday 19 February 2008 12:34:33 pm
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
|
Abdelkader RHOUATI
|
Tuesday 19 February 2008 1: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/technical_manual/4_0/reference/template_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.
Abdelkader RHOUATI
Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery
|
Softriva .com
|
Tuesday 19 February 2008 8:07:52 pm
still did not work as the object and embed tags gets removed.
|
Stéphane Bullier
|
Wednesday 20 February 2008 12:36:10 am
Hello, I think you have to check settings in settings/override/content.ini.append.php :
[CustomTagSettings]
IsInline[youtube]=true
Stéphane
|
Softriva .com
|
Wednesday 20 February 2008 3:55:27 am
I tried it but still no help :(.
|
Stéphane Bullier
|
Wednesday 20 February 2008 4:39:50 am
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.
Stéphane
|
André R.
|
Wednesday 20 February 2008 4:50:42 am
> 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
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom
|
Softriva .com
|
Wednesday 20 February 2008 6:04:31 am
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.
|
Sandra Parente
|
Wednesday 20 February 2008 10:59:01 am
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.
Sandra Parente
www.netbliss.it
|
Sandra Parente
|
Wednesday 20 February 2008 11:20:20 pm
Now I have tried to insert a video from You Tube on a 3.9.2 installation, but it doesn't display it, so I think OOzy has to upgrade to 3.9.3, which seems to be the minimum version supporting this function...
Sandra Parente
www.netbliss.it
|
Softriva .com
|
Thursday 21 February 2008 12:24:32 am
Hello, I have upgraded to 3.9.4 and still did not work so I upgraded to 3.10.0 and everything worked ok now. Thank you all for your help. OOzy
|
Bernd Winkelmann
|
Monday 10 March 2008 8:48:15 am
thanks to you <b>Sandra<b/> that is a very easy and realized in seconds solution to embed this objects so i can report here that this solution is fine working in 4.0.x also lorbas
|
Richard Bayet
|
Thursday 28 August 2008 2: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.
|
Richard Bayet
|
Thursday 28 August 2008 2: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
|
Richard Bayet
|
Friday 29 August 2008 4:47:00 am
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 ...
|
Richard Lundberg
|
Wednesday 29 October 2008 10:46:16 am
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.
www.peakm3.com
|
Sandra Parente
|
Thursday 30 October 2008 12: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!
Sandra Parente
www.netbliss.it
|
Darren Ong
|
Monday 12 January 2009 8:21:09 pm
Hi, I read the articles and know that there is a solution for 3.9 and above. Does anyone has any idea if there is any solution to add YouTube Object for 3.8? Thanks!
|
Richard Lundberg
|
Friday 23 January 2009 4:06:13 pm
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
www.peakm3.com
|
*- pike
|
Friday 29 October 2010 7:21:49 am
"
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
---------------
The class eZContentObjectTreeNode does.
|