Forums / Setup & design / Filter on a checkbox

Filter on a checkbox

Author Message

Daniel Guerrier

Saturday 23 April 2005 3:50:18 pm

Hello

I am trying to fetch some data, but I would like to limit it to items that have a checkbox checked.
The content class has a checkbox field called 'featured' and I assume I am supposed to use a boolean to compare. I have tried the following without success.

{let items=fetch( 'content', 'list', hash( 'parent_node_id', 96, 'limit', 5,
	 							'attribute_filter', array( array('featured','=',true()))								
	  ) )}
{let items=fetch( 'content', 'list', hash( 'parent_node_id', 96, 'limit', 5,
	 							'attribute_filter', array( array('featured','=',true))								
	  ) )}

even

{let items=fetch( 'content', 'list', hash( 'parent_node_id', 96, 'limit', 5,
	 							'attribute_filter', array( array('featured','=','yes'))								
	  ) )}

Since 'yes' appeared in the preview.

Daniel Guerrier

Saturday 23 April 2005 3:54:02 pm

Solved.

I needed to add the class type as well as the field attribute.