Problem with fetch

Author Message

Trevor Clowry

Tuesday 14 June 2005 6:39:24 am

There is probably an easy solution to this.

Basically i want to show a testimonial on every page on the site. I have created a new class called testimonial. And created a folder called testimonials which contains 5 testimonial instances.

I have created a template which i want to add to each page. However when i try to fetch the infromation from the testimonials, to display to the screen i only receive the names of the testimonials.

{let testimonials=fetch('content',list,hash(parent_node_id,81))
}
{section name=test loop=$testimonials}
<img src="{$test:item.logo}" />
{$test:item.name}<br>
{$test:item.testcopy}<br>
{$test:item.person}<br>
{$test:item.position}<br>
{$test:item.company_name}<br>
{$test:item.company_location}<br>
{/section}
{/let}

 

The only part that is displaying information to the screen is {$test:item.name}.
81 is node_id of the testimonial folder, which contains all the testimonials.
How do i show the other attributes?
Can anyone help?

Nabil Alimi

Tuesday 14 June 2005 6:50:40 am

Hi trevor,

First, when using loop I use :

{section var=test...}

instead of

{section name=test.. } 

And when I want to display each attribute, I use {$test.object.data_map.NAMEOFYOURATTRIBUTE.content}

But anyway, if you want to display an attribute of your class, you should use {$test:item.data_map.NAMEOFYOURATTRIBUTE.content).
Or by using {attribute_view_gui attribute=$test:item.data_map.YOURATTRIBUTE}

(I hope I ain't wrong ^^)

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

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 21:00:38
Script start
Timing: Jan 18 2025 21:00:38
Module start 'layout'
Timing: Jan 18 2025 21:00:38
Module start 'content'
Timing: Jan 18 2025 21:00:39
Module end 'content'
Timing: Jan 18 2025 21:00:39
Script end

Main resources:

Total runtime0.7211 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.0051 589.0234152.6094
Module start 'layout' 0.00510.0020 741.632839.4141
Module start 'content' 0.00710.7127 781.0469527.5859
Module end 'content' 0.71970.0013 1,308.63288.5000
Script end 0.7211  1,317.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4165160.0002
Check MTime0.00120.1621160.0001
Mysql Total
Database connection0.00070.102310.0007
Mysqli_queries0.677693.9717540.0125
Looping result0.00050.0735520.0000
Template Total0.695596.520.3478
Template load0.00190.260620.0009
Template processing0.693696.189120.3468
Template load and register function0.00020.028410.0002
states
state_id_array0.00090.125610.0009
state_identifier_array0.00070.091020.0003
Override
Cache load0.00160.2209230.0001
Sytem overhead
Fetch class attribute can translate value0.00060.089920.0003
Fetch class attribute name0.00090.126330.0003
XML
Image XML parsing0.00060.081020.0003
class_abstraction
Instantiating content class attribute0.00000.001330.0000
General
dbfile0.00080.1097160.0000
String conversion0.00000.000840.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
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs