Forums / Developer / Fetching content from multimple nodes..

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

eZ debug

Timing: Jan 31 2025 01:21:45
Script start
Timing: Jan 31 2025 01:21:45
Module start 'content'
Timing: Jan 31 2025 01:21:45
Module end 'content'
Timing: Jan 31 2025 01:21:46
Script end

Main resources:

Total runtime0.2550 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0105 587.9531370.2891
Module start 'content' 0.01050.0134 958.24221,009.6563
Module end 'content' 0.02390.2310 1,967.89843,898.2422
Script end 0.2549  5,866.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00491.9092200.0002
Check MTime0.00170.6615200.0001
Mysql Total
Database connection0.00140.560810.0014
Mysqli_queries0.151859.55401410.0011
Looping result0.00160.62711390.0000
Template Total0.230690.510.2306
Template load0.00080.318910.0008
Template processing0.229890.135610.2298
Override
Cache load0.00060.229510.0006
Sytem overhead
Fetch class attribute can translate value0.00180.686410.0018
XML
Image XML parsing0.00020.079910.0002
General
dbfile0.00893.4943200.0004
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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