Forums / Setup & design / How to use fetch function like in the .tpl files

How to use fetch function like in the .tpl files

Author Message

Jun Zheng

Monday 24 November 2008 10:27:27 pm

Hi all,
I want to get some infomation using fetch function like in the template used.

$top_menu_items=fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id,
                                                          'sort_by', $root_node.sort_array,
                                                          'class_filter_type', 'include',
                                                          'class_filter_array', ezini( 'MenuContentSettings', 'TopIdentifierList', 'menu.ini' ) ) )

But I don't know how to use it in the php file. I found the list function through the function_definition.php ,there are so many parameters,

function fetchObjectTree( $parentNodeID, $sortBy, $onlyTranslated, $language, $offset, $limit, $depth, $depthOperator,
                              $classID, $attribute_filter, $extended_attribute_filter, $class_filter_type, $class_filter_array,
                              $groupBy, $mainNodeOnly, $ignoreVisibility, $limitation, $asObject, $objectNameFilter, $loadDataMap = true )

I only want to use four parameters like in the template file or how to set the other parameters that i don't use. Want can i do ??

Kristof Coomans

Monday 24 November 2008 11:11:38 pm

Hi Jun

Lukasz wrote a nice blog article about this: http://serwatka.net/blog/fetching_ez_publish_content_objects_with_php. Some info is slightly outdated for eZ Publish 4, but there are remarks about that in the comments. Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Forex System Profi

Wednesday 26 November 2008 2:52:10 am

> http://serwatka.net/blog/fetching_ez_publish_content_objects_with_php

Thank you, Kristof !

Metatrader Expert ( http://iticsoftware.com ), Scalping Forex ( http://iticsoftware.com/scalping-forex.php ), Forex Trading Systems ( http://shop.profxtools.com )

Jun Zheng

Wednesday 26 November 2008 7:06:27 pm

Wonderful blog!
Kristof ,Thank you very much!