Fetching content from multimple nodes..

Author Message

K259

Friday 23 April 2004 5:38:19 am

It's easy I guess, but I haven't found any doc on this.
How can I fetch content(children) for mynode from multiple nodes?
Let's say I want for "mynode" to get objects from nodes with ID 42, 44 and 46.

This is the code for fetching from 1 node:
{let mynode=fetch(content,node, hash(node_id, 42)}

And what's the syntax for multiple nodes?

Eirik Alfstad Johansen

Friday 23 April 2004 6:07:17 am

Hi Zinistry,

Are you referring to something like this?

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

Sincerely,

Eirik Johansen
http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

K259

Friday 23 April 2004 6:20:55 am

Nope, sorry. I want to fetch content from multiple nodes. Let's say I want on a page to list the 6 latest news from different categories with different parents.

For example:
I got a news site based on categories: News/economy/articles, News/travel/articles, Info/music/articles, Mobile/news/articles..

The list with the 6 latest news shall list the content(articles) from the categories above in just one fetch.

Eirik Alfstad Johansen

Friday 23 April 2004 7:02:22 am

Hi Zinistry,

Then I would do a fetch using node 2 as the parent, specifying the article class in the class_filter_array, and going the neccessary levels deep. Something like this:

{let articles=fetch(content, list, hash(limit, 6, parent_node_id, 2, depth, 3, sort_by,array(published,false()), class_filter_type, include, class_filter_array, array(article)) )}

Sincerely,

Eirik Johansen
http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

K259

Friday 23 April 2004 7:11:19 am

But then I get articles from categories I don't want to include :)
And that's not what I want, sorry ;)

Ole Morten Halvorsen

Friday 23 April 2004 7:26:17 am

Zinistry,

You can fetch a list from multiple nodes.

This should work:

{let articles=fetch( content, list, hash( parent_node_id, array( $id1, $id2, $id3 ) ) )}

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

K259

Friday 23 April 2004 10:14:22 am

Great! Tnx Ole! :)

I'll try it later in the evening!

Mikhail Chekanov

Monday 11 April 2005 9:01:39 am

{let articles=fetch( content, list, hash( parent_node_id, array( $id1, $id2, $id3 ) ) )}

Can anyone confirm that it does work with 3.5.1?
Doesn't work for me :(

--
mike
#6595551

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 19 2025 09:40:06
Script start
Timing: Jan 19 2025 09:40:06
Module start 'layout'
Timing: Jan 19 2025 09:40:06
Module start 'content'
Timing: Jan 19 2025 09:40:06
Module end 'content'
Timing: Jan 19 2025 09:40:06
Script end

Main resources:

Total runtime0.0198 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 590.5313152.6250
Module start 'layout' 0.00680.0062 743.156339.4453
Module start 'content' 0.01300.0048 782.601697.4609
Module end 'content' 0.01780.0020 880.062538.3047
Script end 0.0198  918.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002512.8260140.0002
Check MTime0.00115.7682140.0001
Mysql Total
Database connection0.00146.895610.0014
Mysqli_queries0.006432.139030.0021
Looping result0.00000.226010.0000
Template Total0.00168.310.0016
Template load0.00094.486910.0009
Template processing0.00083.806610.0008
Override
Cache load0.00063.120310.0006
General
dbfile0.00031.538580.0000
String conversion0.00000.050540.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