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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:45:05
Script start
Timing: Jan 18 2025 11:45:05
Module start 'layout'
Timing: Jan 18 2025 11:45:05
Module start 'content'
Timing: Jan 18 2025 11:45:05
Module end 'content'
Timing: Jan 18 2025 11:45:05
Script end

Main resources:

Total runtime0.7352 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.0313152.6406
Module start 'layout' 0.00630.0044 740.671939.4609
Module start 'content' 0.01060.7231 780.1328534.4688
Module end 'content' 0.73370.0014 1,314.601612.4688
Script end 0.7351  1,327.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4764160.0002
Check MTime0.00140.1884160.0001
Mysql Total
Database connection0.00080.115610.0008
Mysqli_queries0.676792.0510570.0119
Looping result0.00060.0875550.0000
Template Total0.692994.320.3465
Template load0.00210.290320.0011
Template processing0.690893.962720.3454
Template load and register function0.00010.018210.0001
states
state_id_array0.00090.128610.0009
state_identifier_array0.00070.098520.0004
Override
Cache load0.00180.2471260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.090420.0003
Fetch class attribute name0.00100.138240.0003
XML
Image XML parsing0.00060.084120.0003
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00120.1641160.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs