Forums / Setup & design / How to use attribute_filter on an ezenum type?

How to use attribute_filter on an ezenum type?

Author Message

Luis Cruz

Tuesday 08 June 2004 11:22:39 am

Greetings all; I am running 3.3-5 and am running into difficulty trying to filter on an ezenum attribute. I have defined a class called "Event"; inside this class is an ezenum attribute called "Language". It values are defined as follows (Enum Element, Enum Value):

All, 0
English, 1
German, 2

I have created five events; four of the events are flagged with "All" and one with "German". Now, I have template used to pull all the events in a folder and produce a list. When I use the following line, all five events are pulled:

{let children=fetch(content, list, 
	hash(parent_node_id, $node.node_id, sort_by, $node.sort_array, limit, 5, 
		'attribute_filter', 
			array('or', array(192, '=', '0'), array(192, '=', '1'))
))}

I have also tried various permutations on the above statement (e.g., quoting/unquoting various portions like attribute_filter, using 'event/language' rather than node ID in the filter, having the value be 'English', using >=, etc.). No error message is output in debug mode, and all five events are pulled.

If I change the filter to use a different attribute, the filter works fine. I have searched through the forums and have found conflicting information on whether or not this is an unresolved or resolved bug. Can anyone provide an solution to my problem?

Cheers.

Sebastian Sprenger

Wednesday 09 June 2004 2:48:06 am

Hi!

I can't provide you a solution, but I can remember that I also had problems using ezenum. Therefore I used the type ezselect. (I think it's called so, but I'm not sure)
Perhaps this could help you, too.

Sebastian

Paul Forsyth

Wednesday 09 June 2004 2:50:57 am

Yes, try out ezselect. It was written to replace ezenum.

paul

--
http://www.visionwt.com

Luis Cruz

Wednesday 09 June 2004 1:44:22 pm

Thanks; ezselect does the job.