Problem with Fetch/Namespace

Author Message

Mahesh Arvind

Friday 02 January 2004 11:29:53 pm

Hi,

I am using a nested fetch operation. Plz look at the code below.

{let providers=fetch('content','list', hash( parent_node_id,"110", class_filter_type, "include", class_filter_array, array(1)))}
{section loop=$:providers}

{let noofchildren=fetch('content','list_count', hash('parent_node_id',$item.node_id,'class_filter_array',array(17),'class_filter_type','include'))}

{section name=main show = $noofchildren|gt(0)}

{$item.node_id} //first item

{let name=disp children=fetch('content','list', hash( parent_node_id,$item.node_id,class_filter_type, "include", class_filter_array, array(17)))}

{$item.node_id} // second item

{/let}
{/section}
{/let}
{/let}

The first and second item.node_id gives the same node id. In fact I want to display the attributes of the children of the first item.node_id. Should I need to use $item near "second" or should I use something like $main:disp:item.node_id, which does not show any results. Plz help.

Mahesh

Thanks & Regards
Mahesh

Shurbann Martes

Saturday 03 January 2004 4:33:56 am

Have you tried:
=========================================
{let children=fetch('content','list', hash( parent_node_id,$item.node_id,class_filter_type, "include", class_filter_array, array(17)))}
{section name=disp loop=$:children}//start a new section with name = disp

{$disp.item.node_id} // second item use the name disp

{/section}
{/let}
===============================================

Hope this helps.

One tip:
From version 3.2.4 and above use instead of nrs in the class_filter_array (for example 17) the identifier name of the classes (for example 'myclass')

Greets,
-Shurbann

Mahesh Arvind

Saturday 10 January 2004 12:49:42 am

Hi Shurbann

Thanks for the reply. In fact, I got it by {$:item.node_id} itself.

Mahesh

Thanks & Regards
Mahesh

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 31 2025 06:27:51
Script start
Timing: Jan 31 2025 06:27:51
Module start 'layout'
Timing: Jan 31 2025 06:27:51
Module start 'content'
Timing: Jan 31 2025 06:27:51
Module end 'content'
Timing: Jan 31 2025 06:27:51
Script end

Main resources:

Total runtime0.0119 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.1328151.2109
Module start 'layout' 0.00450.0022 739.343836.6484
Module start 'content' 0.00680.0035 775.992290.1406
Module end 'content' 0.01030.0016 866.132833.9922
Script end 0.0119  900.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002117.3233140.0001
Check MTime0.00108.0520140.0001
Mysql Total
Database connection0.00076.196910.0007
Mysqli_queries0.002319.450330.0008
Looping result0.00000.100010.0000
Template Total0.001310.710.0013
Template load0.00075.667210.0007
Template processing0.00064.979510.0006
Override
Cache load0.00053.924010.0005
General
dbfile0.00021.963080.0000
String conversion0.00000.074040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs