Share » Forums » General » Fetching different classes with...

Fetching different classes with common attribute

Fetching different classes with common attribute

Monday 26 July 2004 8:00:20 am - 3 replies

Author Message

Roy Bøhmer

Tuesday 27 July 2004 1:23:40 am

The short answer is no!
Even if the identifiers are the same, ez sees them as two completely different attributes. (They've got their own attribute-id). When you define filter you either use the attribute-id or specifies which class you use (article/date). As far as I know it NOT possible to write

fetch(content, list, ...., 
    attribute_filter('or', 
                     array('article/date','<',current_date()),
                     array('interview/date','<',current_date())
                     ....)

My advice is to always do a class_filter when you're doing a attribute_filter.
A tip could be to do one fetch for articles and one for interviews, and afterwards combine the two arrays into one usin append. http://ez.no/ez_publish/documentation/reference/template_operators/arrays/append
The problem with this metod is that it is hard to do a proper sort across the classes.

By the way:
There is one advantage by giving your attribute the same identifiers: You can reuse template-code.

Roy

Bruce Morrison

Thursday 29 July 2004 4:20:02 pm

Hi Roy

> My advice is to always do a class_filter when you're doing a attribute_filter.

I'm pretty sure that I've found these to be mutually exclusive as one implies the other.
See: http://ez.no/community/forum/developer/using_attribute_filter_on_related_object_attributes

Have you had success?

Cheers
Bruce http://www.designit.com.au

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Andrew Vorobyov

Monday 13 June 2005 4:10:01 pm

I can't access in attribute_filter ezdate attribute by name

This works:

array(268,'>=',makedate(1,1,sub($today.year,$params.ageto)

This does NOT work:

array('class_name/ez_date_attr_name','>=',makedate(1,1,sub($today.year,$params.ageto)

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

36 542 Users on board!

Forums menu