Sunday 26 December 2010 12:32:42 pm
Hi, The custom tag idea is probably the easiest way to go, as Olav pointed out. Here is how to proceed to add your own custom tag. 1. Open your preferred content.ini.append.php, and add the following :
[CustomTagSettings]
AvailableCustomTags[]=youtube
CustomTagsDescription[youtube]=YouTube video
[youtube]
CustomAttributes[]=video_id
CustomAttributes[]=width
CustomAttributes[]=height 2. Create a template named youtube.tpl in <your_custom_extension>/design/standard/templates/content/datatype/view/ezxmltags/ , containing the following code :
{if $width|not}{set $width=425}{/if}
{if $height|not}{set $height=344}{/if}
<div class="object-center">
<object type="application/x-shockwave-flash" width="{$width|wash}" height="{$height|wash}" data="http://www.youtube.com/v/{$video_id|wash}&hl=en&fs=1&rel=0&color1=0x666666&color2=0xf15e22">
<param name="movie" value="http://www.youtube.com/v/{$video_id|wash}&hl=en&fs=1&rel=0&color1=0x666666&color2=0xf15e22" />
</object>
</div> 3. Clear the caches (INI and template) You should now be able to choose the "YouTube video" custom tag from the pop-up showing-up when clicking the <?> button, from the Online Editor. Cheers !
--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board
eZ Publish Community on twitter: http://twitter.com/ezcommunity
t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye
|