simple Download Link???

Author Message

Tim Achnitz

Monday 22 September 2003 5:47:43 am

Hi,

I've a class with a Datatype BinaryFile. How does a "download-link" look like? ( {attribute_view_ ....} ???)

thx

Tim Achnitz

Tuesday 23 September 2003 12:25:33 am

I turned on the Template Debugging in the Backend and found out, that there is this ezbinaryfile.tpl but I don't know how to use it. Maybe you know?

James Packham

Tuesday 23 September 2003 3:35:13 am

I can only partially answer this because I'm having my own troubles with this feature :)

I used the little magnifying glass icon under "related objects" area (to the right of the screen whilst creating/editing files) to find the object (file). When you click ok you are left with a little bit of detail about the object, it's name, object ID and link location.

Copy and paste the link location into the xml format for a link and change it to normal (non admin) location (assuming you're using uri like me) so you get something like:

<link class='file' href='http://192.168.0.1/news/content/view/full/59'>here</link>

Congratulations, now you should have something that doesn't work but looks a lot better than an error message. But don't feel bad, this is as far as I've managed to get too ;)

Please let me know if you figure out what to do next! I will do likewise! Sorry I couldn't be more help!

~James~

Bjørn Kaarstein

Wednesday 24 September 2003 2:38:47 am

do the fetching...

then....

{node_view_gui view=full content_node=$Child:item}

Put this in the ezbinaryfile.tpl

a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.content.original_filename)|ezurl}>{$attribute.content.original_filename|wash(xhtml)}</a> <td align="right">{$attribute.content.filesize|si(byte)}</td>

Regards Bjørn

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 19:29:02
Script start
Timing: Jan 18 2025 19:29:02
Module start 'layout'
Timing: Jan 18 2025 19:29:02
Module start 'content'
Timing: Jan 18 2025 19:29:02
Module end 'content'
Timing: Jan 18 2025 19:29:02
Script end

Main resources:

Total runtime0.8423 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.0065 589.5625152.6094
Module start 'layout' 0.00650.0030 742.171939.4297
Module start 'content' 0.00950.8310 781.6016543.2109
Module end 'content' 0.84060.0017 1,324.812512.1875
Script end 0.8422  1,337.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4130160.0002
Check MTime0.00140.1705160.0001
Mysql Total
Database connection0.00170.203710.0017
Mysqli_queries0.789193.6863620.0127
Looping result0.00060.0700600.0000
Template Total0.807895.920.4039
Template load0.00280.329720.0014
Template processing0.805195.580820.4025
Template load and register function0.00010.014010.0001
states
state_id_array0.00090.109710.0009
state_identifier_array0.00070.083520.0004
Override
Cache load0.00180.2099240.0001
Sytem overhead
Fetch class attribute can translate value0.00070.079030.0002
Fetch class attribute name0.00190.224450.0004
XML
Image XML parsing0.00070.084830.0002
class_abstraction
Instantiating content class attribute0.00000.002350.0000
General
dbfile0.00070.0876160.0000
String conversion0.00000.001240.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs