Forums / Developer / Fetch list with attribute_filter (relation list)

Fetch list with attribute_filter (relation list)

Author Message

Jonathan Marsigny

Monday 07 February 2005 4:46:35 am

Hello,

I 'd fetch a node list wich is filtering with attribute_filter.

Like this :

{let prod=fetch('content','list',
hash(parent_node_id,58,

sort_by,array('published',false()),
				
class_filter_type, include, 

class_filter_array, array('21'),
				attribute_filter,array('and',array(223,'=',$:item.node_id)),
				limit,$page_limit,offset,$view_parameters.offset))}

Do I do something wrong?

Jonathan Marsigny

Tuesday 08 February 2005 6:46:48 am

Ok...I just find it.

replace attribute_filter by attribute_filter_array

Jonathan Marsigny

Tuesday 08 February 2005 9:32:41 am

No, it's not correct :-(

Eirik Alfstad Johansen

Tuesday 08 February 2005 11:11:08 am

Hi Jonathan,

Try replacing the "and" in your attribute filter array with "or", like this:

attribute_filter, array('or', array(223, '=', $:item.node_id)),

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Jonathan Marsigny

Wednesday 09 February 2005 2:18:22 am

No it doesn't work.

I don't know why.

Maybe, because the attribute is a relation list ?

Do you have an example whith relation list?

Andrew Vorobyov

Sunday 29 May 2005 4:30:54 am

  attribute_filter,array('and',array(223,'=',$:item.node_id)),

This lacks second array(223,'=',$:item.node_id) for 'and' pair