How to realise downloadlink

Author Message

Oliver Dzierzon

Wednesday 25 February 2009 1:56:25 am

How can I realise an downloadlink to a object of the class "file" using eZ Publish 4.01?

content/view/download/<objid>

doesn't work

Thank you. ciao Olli

Yannick Komotir

Wednesday 25 February 2009 3:27:36 am

and

   {content_view_gui content_object=$object}
 

?

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Oliver Dzierzon

Wednesday 25 February 2009 4:24:16 am

Thank you, but I do not realy know how to use it.

In my case i have a object "download_group" which hast attribute object relations to a some objects of the class "file".

First I go and fetch all related file objects

{def $relationlist =fetch('content','related_objects',
hash('object_id',$box.contentobject_id,'attribute_identifier',403 ))}

this works fine. And now, I want to loop the relationslist and each time output a downloadlink.

{foreach $relationlist as $relation}
{content_view_gui content_object=$relation.id view="download"}
{/foreach}

However there is no download output but also no error message.
Do I have to create my own download template? And how?

Thank you

Yannick Komotir

Wednesday 25 February 2009 5:04:07 am

don't write your own script, ez do that better

{foreach $relationlist as $relation}
 {node_view_gui content_node=$relation view="full"}
{/foreach}

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Oliver Dzierzon

Wednesday 25 February 2009 5:19:53 am

It's great, thank you very much. Now it works fine.

I need much more experience using eZ publish.

ciao

Oliver Dzierzon

Wednesday 25 February 2009 5:29:15 am

It works fine but nevertheless I have a question:

How can I customize the download output?

The current output looks like:
<i>
Excel
Aktuelle Version
1
Name:
Excel
Description:
File:
Mappe.xls 13,50 kB
Tags:
</i>

but I want to create the following output:
<i>
<mime_type.icon> <file_name> <file_size>
</i>
thats all

ciao olli

Yannick Komotir

Wednesday 25 February 2009 6:57:10 am

create an override on the full view of file.tpl

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

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:30:03
Script start
Timing: Jan 18 2025 22:30:03
Module start 'layout'
Timing: Jan 18 2025 22:30:03
Module start 'content'
Timing: Jan 18 2025 22:30:03
Module end 'content'
Timing: Jan 18 2025 22:30:03
Script end

Main resources:

Total runtime0.0146 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.0054 587.9063152.6250
Module start 'layout' 0.00540.0027 740.531339.4453
Module start 'content' 0.00810.0049 779.976693.4141
Module end 'content' 0.01290.0016 873.390638.3047
Script end 0.0145  911.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.7841140.0002
Check MTime0.00117.6442140.0001
Mysql Total
Database connection0.00074.982010.0007
Mysqli_queries0.002014.046530.0007
Looping result0.00000.081910.0000
Template Total0.00138.810.0013
Template load0.00074.878810.0007
Template processing0.00063.923710.0006
Override
Cache load0.00053.347010.0005
General
dbfile0.00032.200280.0000
String conversion0.00000.049140.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