Forums / Developer / selection in fetch" function
Roberta Gatti
Thursday 04 March 2004 7:12:02 am
Hi,when I use a "fetch" function can I select only data of a specific datatype?
TIAr.
Alex Jones
Thursday 04 March 2004 7:57:35 am
Yes you can use a <i>class_filter</i> to ensure you only fetch objects of the class (datatype) you want. For example, I have a fetch that only pulls objects of an image class (which happens to be id '5') from a specific folder (which has an id of '522'):
SiteTitleHeader=fetch(content,tree,hash(parent_node_id,522,class_filter_type,include,class_filter_array, array(5)))
Check out the documentation for fetch: http://ez.no/ez_publish/documentation/development/libraries/ez_template/operators/data_fetchhttp://www.ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/fetch_function_examples
There is also a lot of information in the forums and the site as a whole, so a search should provide you with a wealth of data and examples.
Alex
Alex [ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ] <i>When in doubt, clear the cache.</i>
Paul Borgermans
Thursday 04 March 2004 8:44:57 am
And if you want to select objects of a certain class but need to filter based on certain values of attributes (datatypes), you can do that too.
Check the docs that Alex pointed to and also this one:
http://ez.no/ez_publish/documentation/reference/data_fetching/content/list
-paul
eZ Publish, eZ Find, Solr expert consulting and training http://twitter.com/paulborgermans