Friday 05 November 2004 2:09:50 am
Hi, Steps I used to embed flash within an article: 1. Create a flash object ( using ez publish standard class flash or make a flash class yourself ) and put it under media folder or anywhere. 2. When edit an article, make this flash object as related object and then insert it into the article. 3. Adding the following code into settings/siteaccess/your_site/override.ini.append to override template.
[embed_flash]
Source=content/view/embed.tpl
MatchFile=embed_flash.tpl
Subdir=templates
Match[class_identifier]=flash
4. Create file embed_flash.tpl and put it under design/your_site/override/templates/. Example of embed_flash.tpl:
<div class="view-embed">
<div class="content-media">
{let attribute=$object.data_map.file}
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="{$attribute.content.width}" height="{$attribute.content.height}" id="objectid{$object.id}">
<param name="movie" value={concat("content/download/",$attribute.contentobject_id,"/",$attribute.content.contentobject_attribute_id,"/",$attribute.content.original_filename)|ezurl} />
<param name="quality" value="{$attribute.content.quality}" />
<param name="play" value="{section show=$attribute.content.is_autoplay}true{/section}" />
<param name="loop" value="{section show=$attribute.content.is_loop}true{/section}" />
<embed src={concat("content/download/",$attribute.contentobject_id,"/",$attribute.content.contentobject_attribute_id,"/",$attribute.content.original_filename)|ezurl}
quality="{$attribute.content.quality}" pluginspage="{$attribute.content.pluginspage}"
width="{$attribute.content.width}" height="{$attribute.content.height}" play="{section show=$attribute.content.is_autoplay}true{/section}"
loop="{section show=$attribute.content.is_loop}true{/section}" name="objectid{$object.id}">
</embed>
</object>
{/let}
</div>
</div>
Regards, wenyue
|