Click and display

Author Message

Franck T.

Friday 18 August 2006 7:50:21 am

Hello everybody,
When fetching related objetcs, I get one or several links. This is the corresponding code:

{def $objects=fetch( 'content', 'related_objects',
                    hash( 'object_id', $node.object.id,'all_relations', true()) )}
       {foreach $objects as $object}
           <a href={$object.main_node.url_alias|ezurl}>{$object.name|wash()}</a>
       {/foreach}

In my site, related objects are mainly PDF or Microsoft Word documents.
My question is: is it possible, on clicking one link, to immediatly open the document without first browsing into ezpublish Media (or Files) folder ?
Thanks for all idea.

Nate Parsons

Wednesday 27 September 2006 1:12:08 pm

Yo Frank,

Try using something like this for your link instead of the url_alias:


{attribute_view_gui attribute=$content_object.data_map.all_resource_file}

(The above code assumes that you've added a "file" attribute to the class object that you're viewing...)

---------------------------------------------------------------------------------
I look forward to an America which will not be afraid
of grace and beauty.

-------------JFK 10/26/63------------------------------------------------

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 11:42:25
Script start
Timing: Jan 18 2025 11:42:25
Module start 'layout'
Timing: Jan 18 2025 11:42:25
Module start 'content'
Timing: Jan 18 2025 11:42:25
Module end 'content'
Timing: Jan 18 2025 11:42:25
Script end

Main resources:

Total runtime0.6888 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.7891152.6094
Module start 'layout' 0.00680.0029 740.398439.4141
Module start 'content' 0.00980.6775 779.8125523.1250
Module end 'content' 0.68730.0015 1,302.93758.1875
Script end 0.6887  1,311.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5284160.0002
Check MTime0.00150.2162160.0001
Mysql Total
Database connection0.00110.163610.0011
Mysqli_queries0.639392.8199540.0118
Looping result0.00130.1954520.0000
Template Total0.654595.020.3273
Template load0.00270.393620.0014
Template processing0.651894.629120.3259
Template load and register function0.00020.034110.0002
states
state_id_array0.00100.138110.0010
state_identifier_array0.00250.367620.0013
Override
Cache load0.00210.3067150.0001
Sytem overhead
Fetch class attribute can translate value0.00160.231020.0008
Fetch class attribute name0.00140.208930.0005
XML
Image XML parsing0.00070.103120.0004
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00080.1176170.0000
String conversion0.00000.001340.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs