embedded override template

Author Message

Glenn MacGregor

Monday 09 August 2004 8:24:25 am

Hello,

I am creating an article type which I use a related object (File) and reference that in the body of the article as a link to the file (pdf). The link goes to the default file view page. I want it to go directly to the pdf, which the link on the file full view does. It seems that I need to override the embed template for the file class. I have done this a I am looking at the /templates/content/datatype/view/ezbinaryfile.tpl and copying it. This is not working because I can't find the objects that have the correct attributes. Within my template I use the $object object, within the ezbinaryfile.tpl the $attribute is used, that is not passed to me in my overridden template. No where in any of the objects I have in my telplate can I find the original_filename or filesize values. Can you give me clue on how to do this please?

Thanks

Paul Forsyth

Monday 09 August 2004 8:38:02 am

This might do the trick:

{let pdf_object=fetch(content, object, hash(object_id, $pdfObjectID)}
{attribute_view_gui attribute=$pdf_object.data_map.file} 
{/let}

replace $pdfObjectID with the object id of your related file. this number should be visible in the admin.

This is a direct solution. It retreives the object and calls attribute_view_gui on that objects file attribute. there may be easier ways, but try this first.

paul

--
http://www.visionwt.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 22:32:02
Script start
Timing: Jan 18 2025 22:32:02
Module start 'layout'
Timing: Jan 18 2025 22:32:02
Module start 'content'
Timing: Jan 18 2025 22:32:02
Module end 'content'
Timing: Jan 18 2025 22:32:02
Script end

Main resources:

Total runtime0.0194 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.0313152.6250
Module start 'layout' 0.00710.0041 741.656339.4453
Module start 'content' 0.01120.0056 781.101689.3359
Module end 'content' 0.01680.0025 870.437530.3047
Script end 0.0193  900.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003015.2870140.0002
Check MTime0.00147.3504140.0001
Mysql Total
Database connection0.00094.679510.0009
Mysqli_queries0.003618.693230.0012
Looping result0.00010.336210.0001
Template Total0.00199.910.0019
Template load0.00125.995910.0012
Template processing0.00073.858110.0007
Override
Cache load0.00084.105610.0008
General
dbfile0.00031.394080.0000
String conversion0.00000.056640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs