Attribute filter in fetch

Author Message

SathishKumar Subramanian

Thursday 11 March 2004 9:20:16 pm

hi,
I have a simple question: does fetch support filtering by the checkbox attribute? I have the following code which doesn't work:

section loop=fetch( content, list, hash( parent_node_id, $language_id, attribute_filter, array( array(339, '=', '1') ), sort_by, array( "priority", true () ) ) )

where the Check box attribute id is 339.

How can I fetch the contents which are only selected by using the checkbox?

if its not supported, is there any other way to do it?

thanks in advance
Sathizh

Iain MacLean

Friday 12 March 2004 12:46:57 am

Hi Sathish

Try adding the 'or' operator to the attribute filter like this:

attribute_filter, array('or', array(339, '=', '1'))

I've just used something like this to filter a fetch result on a checkbox (actually, two checkboxes) in a class and it seems to be working properly.

Cheers

Iain

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 01:13:36
Script start
Timing: Jan 19 2025 01:13:36
Module start 'layout'
Timing: Jan 19 2025 01:13:36
Module start 'content'
Timing: Jan 19 2025 01:13:37
Module end 'content'
Timing: Jan 19 2025 01:13:37
Script end

Main resources:

Total runtime1.0966 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 590.2734152.6250
Module start 'layout' 0.00730.0033 742.898439.4453
Module start 'content' 0.01061.0839 782.3438458.2813
Module end 'content' 1.09450.0020 1,240.62508.3203
Script end 1.0965  1,248.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2871160.0002
Check MTime0.00120.1131160.0001
Mysql Total
Database connection0.00090.078810.0009
Mysqli_queries1.052695.9854540.0195
Looping result0.00060.0515520.0000
Template Total1.060796.720.5304
Template load0.00210.192720.0011
Template processing1.058696.536420.5293
Template load and register function0.00020.017810.0002
states
state_id_array0.00090.078610.0009
state_identifier_array0.00190.171920.0009
Override
Cache load0.00170.1576180.0001
Sytem overhead
Fetch class attribute can translate value0.00060.054420.0003
Fetch class attribute name0.00150.135520.0007
XML
Image XML parsing0.00020.017120.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00080.0689100.0001
String conversion0.00000.000840.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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs