Share » Forums » Setup & design » 'advanced' fetch function problem

'advanced' fetch function problem

'advanced' fetch function problem

Thursday 22 April 2004 2:55:45 am - 6 replies

Modified on Thursday 22 April 2004 3:01:57 am by Alessandro Cipriani

Author Message

Paul Forsyth

Thursday 22 April 2004 3:06:48 am

I think you need a conditional operator as part of your attribute_filter.

Eg

attribute_filter, array(array( 'or', 'article/primo_piano', '=', true(),
                                     'article2/primo_piano', '=', true() ) )

See the doco for this:

http://ez.no/ez_publish/documentation/development/libraries/ez_template/operators/data_fetch

Without this i think the filter just matches on the first condition, though i could be wrong. I haven't used it yet.

paul

--
http://www.visionwt.com

Alessandro Cipriani

Thursday 22 April 2004 3:43:04 am

hi paul

following your suggestion i wrote:


				   {let news_list=fetch( content, tree, hash( parent_node_id, 2,
															  limit, 1,
															  attribute_filter, array('or', array( 'article/primo_piano', '=', true()), array( 'article/prodotti', '=', true() ) ),
															  sort_by, array( published, false() ) ) )}

and it's working.
but this code fetches objects by 2 attributes of the SAME object (article)
if i try to write 'article2/primo_piano' instead 'article/prodotti' i don't get anything...

any suggestion?

best regards
alessandro

Paul Forsyth

Thursday 22 April 2004 4:05:36 am

As you have added a new class have you added this class to your permissions for your current user? If you dont have the role permissions set it wont be returned.

paul

--
http://www.visionwt.com

Alessandro Cipriani

Thursday 22 April 2004 4:53:17 am

yes paul
the new class (article2) is displayed without problems by all. The example you suggested me is about two attributes of the same class, while my need is to fetch two attributes of two different classes.
i think that this a sintax problem...

any hint?
cheers
alessandro

Paul Forsyth

Thursday 22 April 2004 5:05:18 am

Ah, i see. Well, the best thing is to use two fetchs then, one for each class. Once you have this you can check the arrays and do the appropriate action.

paul

--
http://www.visionwt.com

Paul Forsyth

Thursday 22 April 2004 5:07:48 am

Might also be worth filing a bug about this. The fetch doesn't seem to be doing what it should be doing.

paul

--
http://www.visionwt.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu