Forums / Setup & design / How can i count the articales number in main folders ?

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 ;)

eZ debug

Timing: Jan 18 2025 04:19:41
Script start
Timing: Jan 18 2025 04:19:41
Module start 'content'
Timing: Jan 18 2025 04:19:41
Module end 'content'
Timing: Jan 18 2025 04:19:41
Script end

Main resources:

Total runtime0.1897 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.0703180.8125
Module start 'content' 0.00690.0135 769.882897.9453
Module end 'content' 0.02040.1692 867.8281527.1250
Script end 0.1896  1,394.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00432.2593200.0002
Check MTime0.00150.7824200.0001
Mysql Total
Database connection0.00080.402810.0008
Mysqli_queries0.127467.15621410.0009
Looping result0.00170.90191390.0000
Template Total0.168688.910.1686
Template load0.00100.533610.0010
Template processing0.167688.379010.1676
Override
Cache load0.00070.362810.0007
Sytem overhead
Fetch class attribute can translate value0.00070.374910.0007
XML
Image XML parsing0.00020.125510.0002
General
dbfile0.00583.0594200.0003
String conversion0.00000.003630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs