Fetching one node

Author Message

Carl Worswick

Wednesday 06 October 2004 7:08:25 am

Apologies first, I am a bit of a newbie to this having inherited a website with little knowledge of the world wide web.

Firstly I want to fetch articles from a node without all the children nodes being fetched too. Simply I want just the articles within that folder and not articles within folders below that node.

Any information would be gratefully received.

Lazaro Ferreira

Wednesday 06 October 2004 12:02:18 pm

Hi,

Use

depth

parameter take a look at :

http://ez.no/ez_publish/documentation/customization/tips_tricks/fetch_function_examples

if it didn't work, you can post your offending tpl code , to take a look at it

Lazaro
http://www.mzbusiness.com

Carl Worswick

Monday 11 October 2004 8:40:04 am

Thanks for your help I will have a look at the documentation that you refered me to and get back to you,
thanks again

Carl Worswick

Monday 11 October 2004 8:49:18 am

This is the commands I am currently using

{let news_list=fetch( content, list, hash( node_id, 229,

limit, 20,

sort_by, array( published, false() ),

) )}

Lazaro Ferreira

Monday 11 October 2004 11:55:47 am

then you aren't using the depth parameter , aren't you ?

Lazaro
http://www.mzbusiness.com

Carl Worswick

Tuesday 12 October 2004 5:26:21 am

No I am not currently using the depth parametre and to be quite honest I didn't even know it existed.

I will have a look and see if I can implement it myself, but, being a complete novice at this, I may be back requiring your help again!

Thanks for the advice anyway, it's gratefully received.

Marko Žmak

Tuesday 12 October 2004 8:44:32 am

Try this:

{let news_list=fetch( content, list, hash( parent_node_id, ###,
		limit, 20,
		sort_by, array( published, false() ),

		)
)}

Where ### is the node number of the folder where the articles are stored. Yu don't need any depth parameter if you specify parent_node_id.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Paul Borgermans

Tuesday 12 October 2004 9:47:40 am

The above still contains a syntax error:

{let news_list=fetch( content, list, hash( parent_node_id, ###,
		limit, 20,
		sort_by, array( published, false() )))}

You probably also want to filter only on articles (assume the class identifier is 'article'):

{let news_list=fetch( content, list, hash( parent_node_id, ###,
		limit, 20,
		sort_by, array( published, false() ),class_filter_type,include,class_filter_array,array('article')))}

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Carl Worswick

Wednesday 13 October 2004 6:36:38 am

Thank you for all your advice but it seems that I am still fetching information from not only the parent node but its children as well.
Is there a way to exclude children nodes and all their articles?

Marko Žmak

Wednesday 13 October 2004 8:44:48 am

This code MUST work. It works for me... Maybe you're doing something else wrong.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Carl Worswick

Sunday 17 October 2004 8:56:30 am

So using that code the articles that you are fetching are from the main node only and not its children?

Marko Žmak

Tuesday 19 October 2004 6:29:47 am

Now I'm not so sure what you really want...

I have a folder which contains several articles as his children, and with the code I posted above I get those childrens (but NOT their children also). Is this what you want?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Carl Worswick

Wednesday 20 October 2004 7:18:45 am

Sorry, it looks like I have made this a little confusing. I think you have now understood. I want to retrieve articles from the parent node and not from folders within that node. For example if I have node "A" and within node A I create several folders - Aa, Ab, Ac, Ad, Ae etc - I only want to pluck articles from node A and not from its children. I know it is possible to do this but I am not sure how.
Thanks

Marko Žmak

Wednesday 20 October 2004 8:16:59 am

Well the code that was posted above does exactly this for me. If it doesn't work for you than maybe you're doing something else wrong.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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

Main resources:

Total runtime0.0150 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.0056 588.0313151.1953
Module start 'layout' 0.00560.0026 739.226636.6172
Module start 'content' 0.00810.0056 775.8438106.2500
Module end 'content' 0.01370.0013 882.093845.9922
Script end 0.0150  928.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002315.4087140.0002
Check MTime0.00106.8314140.0001
Mysql Total
Database connection0.00085.163210.0008
Mysqli_queries0.002717.942030.0009
Looping result0.00000.085610.0000
Template Total0.00106.510.0010
Template load0.00085.310510.0008
Template processing0.00021.189810.0002
Override
Cache load0.00053.396710.0005
General
dbfile0.001510.255180.0002
String conversion0.00000.060240.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