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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 06:17:43
Script start
Timing: Jan 19 2025 06:17:43
Module start 'layout'
Timing: Jan 19 2025 06:17:43
Module start 'content'
Timing: Jan 19 2025 06:17:44
Module end 'content'
Timing: Jan 19 2025 06:17:44
Script end

Main resources:

Total runtime1.2698 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.1484152.6250
Module start 'layout' 0.00610.0027 741.773439.4453
Module start 'content' 0.00891.2594 781.2188426.5938
Module end 'content' 1.26830.0015 1,207.81258.1719
Script end 1.2697  1,215.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3351160.0003
Check MTime0.00140.1081160.0001
Mysql Total
Database connection0.00090.074410.0009
Mysqli_queries1.226896.6147520.0236
Looping result0.00060.0466500.0000
Template Total1.232697.120.6163
Template load0.00300.232520.0015
Template processing1.229696.837820.6148
Template load and register function0.00020.015710.0002
states
state_id_array0.00210.163310.0021
state_identifier_array0.00250.200420.0013
Override
Cache load0.00250.1931140.0002
Sytem overhead
Fetch class attribute can translate value0.00060.048010.0006
Fetch class attribute name0.00100.080720.0005
XML
Image XML parsing0.00010.010810.0001
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00070.0514100.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs