Forums / General / Excluding nodes from a list fetch?
Josh Bair
Monday 04 May 2009 7:55:20 pm
We have 2 list fetches and want to exclude nodes from the first fetch in the second fetch. The parent_node_ids are the same as well as the class_attribute_filter. Is there anyway to do this without an extended attribute filter or unnecessarily fetching the same node twice?
Ideally we would pass an array of node ids to the second fetch and these would be excluded.
Łukasz Serwatka
Monday 04 May 2009 11:30:10 pm
This is not possible I'm afraid. You have to use extended attribute filter if you want to filter on specific node ids. I don't know details behind your implementation logic, but it might be also possible to use offset and max params for foreach template function if you want to skip some first nodes in second loop. Then only one fetch could be used.
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Tuesday 05 May 2009 8:07:07 am
Hey Łukasz,
I was able to use the offset method in a couple tpl locations but we also have an eZ Flow zone with 2 dynamic blocks that could benefit from this. Both blocks use eZFlowLatestObjects -- same class and parent; just a different number of active results.
Bård Farstad
Tuesday 05 May 2009 8:26:22 am
What about writing a custom template function optimized for your fetch? That also enables you to tune the query for your situation and optimize for memory usage and performance.
-bård
Documentation: http://ez.no/doc
Frédéric DAVID
Tuesday 05 May 2009 8:37:59 am
for exclude nodes from list fetch, you can use path in your attribute_filter.
attribute_filter, array( array( 'path', 'not_in', array( path_string, path_string) )
I don't know for the performance of this method.
Blog : http://www.frefred.fr/blog/ez-publish feZ Meta Data : http://projects.ez.no/fezmetadata