Forums / Developer / object relation in attribute filer
Romeo Antony
Sunday 24 October 2010 6:19:12 am
I couldn't set up an objectrelation in attribute filter for the fech functions. can anyone please tell me a single line of code to show how to set it up in fetch functon
André R.
Sunday 24 October 2010 3:16:55 pm
If it is object relation list (plural relation datatype), then you need to use extended attribute filter, there are at least a few on projects.ez.no. If it is object relation, then you should be able to use attribute filter with object id's for filter value(s).
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom
Monday 25 October 2010 12:40:57 am
thank you Andre, I have got the examples you mentioned from ez.no
{fetch( 'content', 'list', hash( 'parent_node_id', 42, 'attribute_filter', array( array( 'article/image', '=', 87 ) ) ) )}This example demonstrates how to do attribute filtering using an attribute of the "Object relation" datatype. Only article nodes that store relation to the specified content object (object ID = 87) in their "image" attribute will be included in the result.
Sander van den Akker
Friday 11 February 2011 8:55:37 am
*bump*
Currently I ran into this limitation of the object relation list datatype. Is there a particular reason why it doens't support filtering?
I tried to find a filter on projects.ez.no without success. WHich filter do you mean exactly? Thanks!
eZ Publish certified developer http://auth.ez.no/certification/verify/392313
Nicolas Pastorino
Friday 11 February 2011 9:29:48 am
Hi Sander,
Just checked shallowly, and found this : http://projects.ez.no/objectrelationfilter , may be of some help to you ?
Cheers,
-- Nicolas Pastorino Director Community - eZ Member of the Community Project Board eZ Publish Community on twitter: http://twitter.com/ezcommunity t : http://twitter.com/jeanvoye G+ : http://plus.tl/jeanvoye
Sunday 13 February 2011 9:28:23 am
Ah yes,
I checked that one, but since the first line is talking about reverse relations I was assuming it wouldn't work for normal relations... but since this extended filter works using an attribute and object id as input, it should support my needs :)
Thanks!