How can i count the articales number in main folders ?

Author Message

Selmah Maxim

Sunday 11 May 2003 2:14:36 am

Hi ..

how can i count the artical numebers in all the main folders ?

i mean if i have :

Main Folder
sub folder 1
sub folder 2
sub folder 2.1
sub folder 2.1.1
sub folder 3

Main folder 2
sub folder 1
sub folder 2
sub folder 2.1
sub folder 2.1.1
sub folder 3

now how can i know how much Main folder , Main folder 2 articale have, and the sub folderes also ?

thx.

Jo Henrik Endrerud

Monday 12 May 2003 5:25:56 am

you can count the number of children to a node by the fetch function 'list_count'

example:

{let noOfArticles=fetch('content','list_count', hash('parent_node_id',2))}

this will count all children of the top folder (node 2)

if you only wish to count articles (class 2) the example will be:

{let noOfArticles=fetch('content','list_count', hash('parent_node_id',2,'class_filter_array',array(2),'class_filter_type','include'))}

remember to terminate your {let} when done with the variable

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

Selmah Maxim

Monday 12 May 2003 6:32:50 am

thanks, i`ll try, but as remember i have tryed befor, the problem was it`s counting the folders also !

Selmah Maxim

Tuesday 13 May 2003 10:07:41 am

Henrik ... didn`t work :(

this will count just the main node articales, i need to count also what the childe folders have !
i had tried this also, didn`t work :(:(

{let Count=fetch(content,tree,hash(hash(parent_node_id,16,'class_filter_array',array(2),'class_filter_type','include'))}
{section loop=$Count name=Get}
{let Su=fetch(content,list_count,(hash(parent_node_id,16,'class_filter_array',array(2),'class_filter_type','include'))}
{$Count:Su}
{/let}{/section}{/let}

any one know how ?

Paul Borgermans

Tuesday 13 May 2003 11:51:18 am

Just add a depth of 0. By default only one level down is assumed. Just add it to your parameter array:

..hash(parent_node_id,16,depth,0,'class_filter_array',array(2),'class_filter_type','include')...

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Selmah Maxim

Wednesday 14 May 2003 1:03:18 am

YES :D

thx alot ;)

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 30 2025 21:35:36
Script start
Timing: Jan 30 2025 21:35:36
Module start 'layout'
Timing: Jan 30 2025 21:35:36
Module start 'content'
Timing: Jan 30 2025 21:35:37
Module end 'content'
Timing: Jan 30 2025 21:35:37
Script end

Main resources:

Total runtime1.2991 sec
Peak memory usage8,192.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0109 588.3750151.2422
Module start 'layout' 0.01090.0052 739.6172220.7500
Module start 'content' 0.01611.2821 960.36724,510.7734
Module end 'content' 1.29820.0008 5,471.140611.7969
Script end 1.2990  5,482.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2857160.0002
Check MTime0.00130.0983160.0001
Mysql Total
Database connection0.00110.083010.0011
Mysqli_queries1.195492.0214680.0176
Looping result0.00070.0525660.0000
Template Total1.217393.720.6086
Template load0.00200.153020.0010
Template processing1.215393.551920.6076
Template load and register function0.00110.083910.0011
states
state_id_array0.00230.179410.0023
state_identifier_array0.00250.196220.0013
Override
Cache load0.00170.1323470.0000
Sytem overhead
Fetch class attribute can translate value0.00160.126530.0005
Fetch class attribute name0.00230.179270.0003
XML
Image XML parsing0.00090.070330.0003
class_abstraction
Instantiating content class attribute0.00000.001270.0000
General
dbfile0.00100.0778170.0001
String conversion0.00000.000740.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs