fetch inside of fetch...

Author Message

Bojan Segic

Monday 13 November 2006 7:22:40 am

Hi I'm trying to fetch content insade of fetch. I've written the following code :

{let children=fetch( content, list, hash( parent_node_id, $node.node_id,
sort_by, $node.sort_array,
) )}

{* LOOP: For each child of the node... *}
{section name=Child loop=$children}


{node_view_gui view=line content_node=$Child:item}
{attribute_view_gui attribute=$:item.object.data_map.title}
{attribute_view_gui attribute=$:item.object.data_map.body}
{$:item.object.data_map.headline.content|wash}

{if eq( $:item.class_identifier, 'table2' )}


{let nebojsa=fetch( content, list, hash( parent_node_id, $:item.node_id,
sort_by, $node.sort_array,
) )}

{* LOOP: For each child of the node... *}
{section name=Child1 loop=$nebojsa}
<p>{attribute_view_gui attribute=$:item.object.data_map.column1}</p>
<p> {attribute_view_gui attribute=$:item.object.data_map.column2}</p>
{/section}
{/let}

{/if}

{* End of loop. *}
{/section}
{/let}

Doesn't work! Any idea?

Thanks in advance

Claudia Kosny

Tuesday 14 November 2006 1:45:17 pm

Hi Bojan

Enable debug output and check whether you get any interesting messages there.
Also try the outer loop first - does this work as expected on its own?
Also please note that looping with a section is deprecated. You should replace this with a foreach: http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_control_structures/looping/foreach

If the debug messages do not help you please post again. But in this case please tell us:
- what exactly does not work (what should happen, what happens instead...)
- what debug messages you get (if any)
- what version of EZ you use

Also please use code tags to surround your code when posting (see description on the right of the textarea when you post something) and indent the code a bit, this makes it much easier to read.

Greetings from Luxembourg

Claudia

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 22:40:08
Script start
Timing: Jan 18 2025 22:40:08
Module start 'layout'
Timing: Jan 18 2025 22:40:08
Module start 'content'
Timing: Jan 18 2025 22:40:08
Module end 'content'
Timing: Jan 18 2025 22:40:08
Script end

Main resources:

Total runtime0.6041 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.0062 587.8047152.6094
Module start 'layout' 0.00620.0032 740.414139.4141
Module start 'content' 0.00950.5927 779.8281470.3047
Module end 'content' 0.60220.0019 1,250.13288.1797
Script end 0.6040  1,258.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5646160.0002
Check MTime0.00140.2331160.0001
Mysql Total
Database connection0.00060.096710.0006
Mysqli_queries0.556392.0956540.0103
Looping result0.00050.0872520.0000
Template Total0.569994.320.2850
Template load0.00230.379820.0011
Template processing0.567693.963020.2838
Template load and register function0.00010.023810.0001
states
state_id_array0.00140.230510.0014
state_identifier_array0.00080.126920.0004
Override
Cache load0.00190.3202440.0000
Sytem overhead
Fetch class attribute can translate value0.00060.094520.0003
Fetch class attribute name0.00090.143720.0004
XML
Image XML parsing0.00030.041920.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00060.1059100.0001
String conversion0.00000.002340.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
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/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: 22
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs