print out flashfile url inside of templates

Author Message

nicholas king

Thursday 26 August 2010 2:27:33 am

Hello all,

i am still wrestling with the template code and am now trying a way to stick a url to a flash file inside of a template

so far i have this

{let videos = fetch('content','tree',
hash(
'parent_node_id',335,
'class_filter_type','include',
'class_filter_array',array('flash'),
'limit',1,
'sort_by',array('published', false())))}
{foreach $videos as $video}
{$video.url}
{$video.file}
{$video.object.data_map.flash_video.content.file}
{$video.data_map.flash.file}
{/foreach}

and none of these work.

Any ideas.

Thanks

Nicholas

Thiago Campos Viana

Thursday 26 August 2010 6:54:46 am

You can debug your template variable with attribute operator, here's a sample:

{videos|attribute( show, 1 )}

or

{foreach $videos as $video}
    {video|attribute( show, 1 )}
{/foreach}

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

nicholas king

Thursday 26 August 2010 8:25:56 am

Thanks for your reply Thiago Campos Viana,

I have just used the function and its fantastic and has solved a load of other problems we have had.

just for the reference its correct usage is

{$video|attribute(show,1)}

Jérôme Vieilledent

Friday 27 August 2010 8:09:09 am

You might want to use attribute_view_gui template function :

{attribute_view_gui attribute=$video.data_map.flash_video}

You can also print out raw URL this way :

{$video.data_map.flash_video.content.filepath|ezroot}

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:01:39
Script start
Timing: Jan 18 2025 11:01:39
Module start 'layout'
Timing: Jan 18 2025 11:01:39
Module start 'content'
Timing: Jan 18 2025 11:01:41
Module end 'content'
Timing: Jan 18 2025 11:01:41
Script end

Main resources:

Total runtime1.4651 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.0469152.6406
Module start 'layout' 0.00770.0031 740.687539.4766
Module start 'content' 0.01081.4529 780.1641610.7188
Module end 'content' 1.46370.0014 1,390.882812.1250
Script end 1.4651  1,403.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2329160.0002
Check MTime0.00130.0917160.0001
Mysql Total
Database connection0.00120.084910.0012
Mysqli_queries1.399195.4913620.0226
Looping result0.00070.0503600.0000
Template Total1.428197.520.7141
Template load0.00240.165720.0012
Template processing1.425797.308320.7128
Template load and register function0.00010.007910.0001
states
state_id_array0.00130.090610.0013
state_identifier_array0.00200.134020.0010
Override
Cache load0.00220.1471430.0001
Sytem overhead
Fetch class attribute can translate value0.00050.031530.0002
Fetch class attribute name0.00160.111270.0002
XML
Image XML parsing0.00470.323530.0016
class_abstraction
Instantiating content class attribute0.00000.000880.0000
General
dbfile0.00510.3506290.0002
String conversion0.00000.000740.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/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
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs