Fetching nodes with different parrent id

Author Message

Runar Skraastad

Monday 24 January 2005 1:05:02 pm

Hi!

I'm trying to fetch nodes in different folders with the same fetch command. I've searched around and found several comments on using array to do this. One is here: http://ez.no/community/forum/developer/fetching_content_from_multimple_nodes

But when i do this it produses no output.

The point of my code is to get hold of nodes wich has parent_node_id X or parrent_node_id Y and so on.

My test codes are:

{let children=fetch( content, list, hash( parent_node_id, array(82, 83)) )}

and

{set list_items=fetch_alias( children, hash( parent_node_id, array(82,83),
                                                             offset, $view_parameters.offset,
                                                             sort_by, $node.sort_array,
                                                             limit, $page_limit ) )}

Can any of you spot what I'm doing wrong or point me in the right direction?

Regards
RuS

Ɓukasz Serwatka

Monday 24 January 2005 1:56:25 pm

AFAIK the parent_node_id should be integer not array. But maybe i`m wrong ...

This should work ...

{section loop=array(82, 83)}
    {section loop=fetch( content, list, hash( parent_node_id, $item ) ) var=Child}
       {$Child.name}<br />
    {/section}
{/section}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Runar Skraastad

Monday 24 January 2005 2:42:37 pm

Thanks Luke, that brings me halfway there. But this vil bring up the children of 82 first and then of 83, but i want them to be sorted by newest first.

Regards
RuS

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 18:14:12
Script start
Timing: Jan 18 2025 18:14:12
Module start 'layout'
Timing: Jan 18 2025 18:14:12
Module start 'content'
Timing: Jan 18 2025 18:14:13
Module end 'content'
Timing: Jan 18 2025 18:14:13
Script end

Main resources:

Total runtime1.1454 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.0050 588.0391152.6406
Module start 'layout' 0.00500.0028 740.679739.4609
Module start 'content' 0.00781.1361 780.1406539.8438
Module end 'content' 1.14390.0014 1,319.984412.1406
Script end 1.1453  1,332.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2816160.0002
Check MTime0.00120.1043160.0001
Mysql Total
Database connection0.00080.068110.0008
Mysqli_queries1.096595.7295570.0192
Looping result0.00060.0516550.0000
Template Total1.114697.320.5573
Template load0.00190.168220.0010
Template processing1.112797.146620.5563
Template load and register function0.00020.016010.0002
states
state_id_array0.00080.065710.0008
state_identifier_array0.00200.172520.0010
Override
Cache load0.00160.1425230.0001
Sytem overhead
Fetch class attribute can translate value0.00090.075320.0004
Fetch class attribute name0.00170.145440.0004
XML
Image XML parsing0.00070.061320.0004
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00160.1415180.0001
String conversion0.00000.000740.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
3content/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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs