file downloadable in template

Author Message

Didier Kalulambi

Friday 05 November 2010 2:33:25 am

I want to put a pdf file downloadable from my
template. if I can have the codes. thank you

Jean-Luc Nguyen

Friday 05 November 2010 9:21:00 am

Hello,

I guess you're searching for (replacing #your_pdf_attribute# by your pdf attribute):

<a href={concat( 'content/download/', 
$node.data_map.#your_pdf_attribute#.contentobject_id, '/', 
$node.data_map.#your_pdf_attribute#.id,'/version/', 
$node.data_map.#your_pdf_attribute#.version , '/file/', 
$node.data_map.#your_pdf_attribute#.content.original_filename|urlencode 
)|ezurl}>your link to download</a>

http://www.acidre.com

Romeo Antony

Friday 05 November 2010 12:25:57 pm

try this, replace with u r file attrbute

here file is the attribute and vald node varable contain downloadable file

<a href=content/download/{$valid_node.object.data_map.file.contentobject_id}/{$valid_node.object.data_map.file.id}/file/{$valid_node.object.data_map.file.content.original_filename }>

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 10:23:52
Script start
Timing: Jan 18 2025 10:23:52
Module start 'layout'
Timing: Jan 18 2025 10:23:52
Module start 'content'
Timing: Jan 18 2025 10:23:53
Module end 'content'
Timing: Jan 18 2025 10:23:53
Script end

Main resources:

Total runtime0.8274 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0113 587.9141152.6250
Module start 'layout' 0.01130.0037 740.539139.4531
Module start 'content' 0.01500.8109 779.9922570.4141
Module end 'content' 0.82590.0014 1,350.406312.1641
Script end 0.8273  1,362.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4359160.0002
Check MTime0.00140.1667160.0001
Mysql Total
Database connection0.00200.240910.0020
Mysqli_queries0.771693.2580590.0131
Looping result0.00060.0746570.0000
Template Total0.786695.120.3933
Template load0.00230.275020.0011
Template processing0.784394.796820.3922
Template load and register function0.00020.019110.0002
states
state_id_array0.00070.083210.0007
state_identifier_array0.00140.166020.0007
Override
Cache load0.00180.2166150.0001
Sytem overhead
Fetch class attribute can translate value0.00060.067430.0002
Fetch class attribute name0.00100.120450.0002
XML
Image XML parsing0.00110.132930.0004
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00220.2678220.0001
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs