Displaying object-image attribute in a template

Author Message

Paul Wilson

Friday 16 May 2003 7:14:37 am

>>Situation:
I have an node_id for an (image) class object, and I want to display the image.

I am working in pagelayout.tpl

>>Question:
This seems like it should be a patheticly simple thing to do, but I just can't see it ! Any ideas or leads to useful documentation?

So far I can
- Display the name of the image object with {$display:item.name}
- Display the full/line object with {node_view_gui content_node=$Display:item}

However I can't get to the image attribute specifically...I've tried
{attribute_view_gui attribute=$display:item.object.data_map.image}

But I don't think I've got the syntax right.

Many Thanks

Jo Henrik Endrerud

Saturday 17 May 2003 7:58:20 am

I assume that the attribute for the image is called "image"

{$display:item.data_map.image.content[large].full_path} will return the path to the image. Place this inside a <img> tag like this:

<img src={$display:item.data_map.image.content[large].full_path|ezroot} />

change large to medium, small or reference to get different sizes of the image.

BTW: I haven't checked this up, I'm writing just from my memory, but I'm almost 100% sure of the syntax. If this doesn't work let me know and I'll look it up (or use the |attribute(show) function to check how to get the path like this: {$display:item.data_map.image.content[large]|attribute(show)}

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

Paul Wilson

Sunday 18 May 2003 12:50:09 am

Thanks enormously! That's it!

Works wonderfully now. :-)

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

Main resources:

Total runtime0.8083 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.0469152.6406
Module start 'layout' 0.00460.0030 740.687539.4922
Module start 'content' 0.00760.7990 780.1797535.6484
Module end 'content' 0.80660.0017 1,315.828112.4375
Script end 0.8082  1,328.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3904160.0002
Check MTime0.00130.1619160.0001
Mysql Total
Database connection0.00050.060610.0005
Mysqli_queries0.755193.4215570.0132
Looping result0.00060.0740550.0000
Template Total0.771995.520.3860
Template load0.00210.262720.0011
Template processing0.769895.234220.3849
Template load and register function0.00010.010610.0001
states
state_id_array0.00110.142210.0011
state_identifier_array0.00090.114720.0005
Override
Cache load0.00180.2187260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.080520.0003
Fetch class attribute name0.00210.263640.0005
XML
Image XML parsing0.00050.061120.0002
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00080.0962160.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs