Create a more attractive file link

Author Message

James Ward

Sunday 17 August 2003 7:54:32 pm

I am attempting to modify the file line view to allow the user to directly download the file without having to click through to the file full view.

Here is the current code:
{default content_object=$node.object
content_version=$node.contentobject_version_object}

<div class="listitem">
<p class="title">{attribute_view_gui attribute=$content_version.data_map.name}</p>
<div class="description">
{attribute_view_gui attribute=$content_version.data_map.description}
</div>
<p class="readmore">{attribute_view_gui attribute=$content_version.data_map.file}</p>
</div>

{/default}

I need to create a link to the file to so that users can also click the name to get to the file but I'm not sure how.

Thanks in advance.

working at www.wardnet.com
blogging at www.jamesward.ca

James Ward

Thursday 21 August 2003 8:24:01 am

OK. Maybe I wasn't specific enough with my question. I need a way to individually extract the url and the file size from a file object.

Rather just display the data_map.file I would like to surround text of my chosing in something like
<a href="{$content_version.data_map.file.url}">

Obivously that does not work but maybe it gives you a better idea of what I would like to accomplish.

There are other places where this comes up, such as the link class and object. I'm sure a solution for one will help me work with the other.

working at www.wardnet.com
blogging at www.jamesward.ca

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

Main resources:

Total runtime0.8317 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0116 588.0156152.6250
Module start 'layout' 0.01160.0062 740.640639.4453
Module start 'content' 0.01780.8125 780.0859490.3047
Module end 'content' 0.83030.0014 1,270.39068.1563
Script end 0.8317  1,278.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00510.6186160.0003
Check MTime0.00200.2358160.0001
Mysql Total
Database connection0.00140.168710.0014
Mysqli_queries0.776793.3797520.0149
Looping result0.00050.0604500.0000
Template Total0.791795.220.3958
Template load0.00300.359120.0015
Template processing0.788794.821520.3943
Template load and register function0.00010.008310.0001
states
state_id_array0.00140.165610.0014
state_identifier_array0.00090.109220.0005
Override
Cache load0.00180.2149250.0001
Sytem overhead
Fetch class attribute can translate value0.00060.072010.0006
Fetch class attribute name0.00100.122730.0003
XML
Image XML parsing0.00030.041910.0003
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00130.1622160.0001
String conversion0.00000.001440.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs