Forums / Setup & design / swfobject and uploading flash files

swfobject and uploading flash files

Author Message

Jeroen Slagt

Tuesday 27 May 2008 4:00:16 am

I am using swfobject for displaying flash movies.

At some places I use flashmovies instead of images.
I want to be able to upload these flash movies though the cms interface.

I use a construction like this in my template

{if $node.object.data_map.image.has_content}
<img src="/{$node.object.data_map.intro_background_image.content[original].full_path}" />
{elseif $node.object.data_map.flash.has_content}
...swfobject code...
{/if}

However, I can't get the full path to the uploaded swf file to put in the swf object code.
How can I get this from within my template?

var so = new SWFObject("{FULL_PATH_TO_UPLOADED_SWF_FILE}", "blah", "560", "150", "8", "#ffffff");

I can't find it anywhere in the documentation...

Jeroen Slagt

Tuesday 27 May 2008 4:19:34 am

I can construct it as follows:

{concat("content/download/",$node.object.data_map.intro_background_flash.contentobject_id,"/",$node.object.data_map.intro_background_flash.content.contentobject_attribute_id,"/",$node.object.data_map.intro_background_flash.content.original_filename)|ezurl}

Felix Laate

Tuesday 27 May 2008 4:51:01 am

Hi Jeroen,

you could make an override for embed/flash.tpl, something like this:

<div class="view-embed">
    <div class="content-media">
    <div id="player">This text will be replaced</div>
    {def $attribute=$object.data_map.file}
var so = new SWFObject({concat("content/download/",$attribute.contentobject_id, "/",
 $attribute.content.contentobject_attribute_id, "/", 
$attribute.content.original_filename)|ezurl}, 'mpl', {$attribute.content.width}, {$attribute.content.height},'9');
so.write('player');
{undef $attribute}
    </div>
</div>

and the include it in your template.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com