Forums / Developer / Problem with Fetch/Namespace

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