counting with "tree_count" not working

Author Message

Alexandre Cunha

Tuesday 16 May 2006 9:53:26 am

Hello,

I have problems using 'tree_count':

{def $max=fetch('content', 'tree_count', hash( parent_node_id, 170),
      class_filter_type, "exclude",

      class_filter_array, array( 'gallery' ),
      class_filter_type, "include",

      class_filter_array, array( 'image' )  )
}

$max returns the counting off all itens inside parent_node_id 170 and ignores all filters.

What is wrong ?

http://AlexandreCunha.com

Kristof Coomans

Tuesday 16 May 2006 11:29:01 am

Hi Alexandre

Put your filters inside the hash like you did with parent_node_id. That will work better ;)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Alexandre Cunha

Wednesday 17 May 2006 5:24:19 am

Thanks Kristof, you are right !

For future reference, the correct template code now is:

 

{def $max_fotos=fetch('content', 'tree_count', hash( parent_node_id, 170,
     class_filter_type, "include",     class_filter_array, array( 'image' )   )   )
}
 

http://AlexandreCunha.com

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 21 2025 17:26:02
Script start
Timing: Jan 21 2025 17:26:02
Module start 'layout'
Timing: Jan 21 2025 17:26:02
Module start 'content'
Timing: Jan 21 2025 17:26:02
Module end 'content'
Timing: Jan 21 2025 17:26:02
Script end

Main resources:

Total runtime0.0132 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.0313151.2266
Module start 'layout' 0.00430.0020 739.257836.6797
Module start 'content' 0.00630.0052 775.937590.1875
Module end 'content' 0.01160.0016 866.125033.9922
Script end 0.0132  900.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002317.1101140.0002
Check MTime0.00117.9588140.0001
Mysql Total
Database connection0.00085.854710.0008
Mysqli_queries0.001914.114330.0006
Looping result0.00000.082910.0000
Template Total0.00128.810.0012
Template load0.00096.845510.0009
Template processing0.00031.934810.0003
Override
Cache load0.00064.208210.0006
General
dbfile0.00021.608780.0000
String conversion0.00000.045040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs