Forums / Developer / Opposite of main_node_only?

Opposite of main_node_only?

Author Message

Mindshare Interactive Campaigns

Monday 03 July 2006 12:04:52 pm

According to http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/list you can use the "main_node_only" parameter with fetch to only bring back nodes whose main location is the node you're using as parent_node_id. For example, if you had this content structure:

|-Folder 1
|----Article A (main location)
|----Article B (main location)
|
|-Folder 2
|----Article C (main location)
|----Article A (<i>reference</i> location)

etc.

Setting main_node_only to true and specifying Folder 2 as my parent_node_id will bring back only Article C. The same fetch with main_node_only set to false will bring back Article C and Article A. What I'm looking for is a way to do this fetch to <b>only</b> pull back Article A (and all other content with a non-main location under Folder 2) when the parent node == Folder 2.

Any ideas? Thanks in advance.

http://www.mindshare.net

Ɓukasz Serwatka

Tuesday 04 July 2006 12:16:53 am

This is not possible with fetch function by default. Workaround can be filtering during foreach loop (check $node.is_main) or with some PHP coding make extended fetch function.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Mindshare Interactive Campaigns

Wednesday 05 July 2006 7:00:37 am

Lukasz,

Thanks for the reply. We'll try that "is_main_node" parameter and filter our fetch results.

http://www.mindshare.net