Forums / Setup & design / Fetching one node

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

eZ debug

Timing: Jan 18 2025 22:32:09
Script start
Timing: Jan 18 2025 22:32:09
Module start 'content'
Timing: Jan 18 2025 22:32:10
Module end 'content'
Timing: Jan 18 2025 22:32:10
Script end

Main resources:

Total runtime1.1219 sec
Peak memory usage4,096.0000 KB
Database Queries231

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 587.6094180.8438
Module start 'content' 0.00850.9657 768.4531744.0781
Module end 'content' 0.97420.1477 1,512.5313353.3359
Script end 1.1219  1,865.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00530.4752210.0003
Check MTime0.00150.1380210.0001
Mysql Total
Database connection0.00070.062210.0007
Mysqli_queries1.016990.63702310.0044
Looping result0.00260.23092290.0000
Template Total1.087997.020.5440
Template load0.00300.266220.0015
Template processing1.084996.700020.5425
Template load and register function0.00030.023510.0003
states
state_id_array0.00130.115410.0013
state_identifier_array0.00140.128920.0007
Override
Cache load0.00270.2382570.0000
Sytem overhead
Fetch class attribute can translate value0.00170.149650.0003
Fetch class attribute name0.00150.1376160.0001
XML
Image XML parsing0.00160.138550.0003
class_abstraction
Instantiating content class attribute0.00000.0030190.0000
General
dbfile0.00450.4026360.0001
String conversion0.00000.000430.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
14content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 45
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs