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.