fetch( 'content', 'list_count' - does not work

Author Message

Heiner Wurbs

Friday 12 May 2006 5:06:48 am

Hi,

I have problems running this list_count functionality:

{def $count=fetch( 'content', 'list_count', hash( 'parent_node_id', $node.node_id, class_filter_type, "include", class_filter_array, array('article)  ) )}
	count = {$count}<br>
{/def}

It counts simply everything inside this parent_node_id and doesn't care about the filters. Even it should work:
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/modules/content/fetch_functions/list_count

Do I sth wrong ?
Heiner

Heiner Wurbs

Friday 12 May 2006 5:27:12 am

Workaround is:

{let article_items=fetch(content,list, hash(parent_node_id, $node.node_id, class_filter_type, "include", class_filter_array, array('article) ) )}
       {section show=gt($article_items|count(),0)}	
....

Marc Boon

Friday 12 May 2006 5:52:12 am

You missed a closing quote after array('article
and {/def} is invalid template code, replace it with {undef}

André R.

Friday 12 May 2006 6:00:41 am

{def $count=fetch( 'content', 'list_count', hash( 
'parent_node_id', $node.node_id, 
'class_filter_type', "include",
'class_filter_array', array('article')
 ) )}

the last ' in ('article') where missing..

Edit: marc got it, but 1 more thing: you should not use $node.node_id unless this is a node template (as in not pagelayout or toolbar template)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 18 2025 21:11:49
Script start
Timing: Jan 18 2025 21:11:49
Module start 'layout'
Timing: Jan 18 2025 21:11:49
Module start 'content'
Timing: Jan 18 2025 21:11:50
Module end 'content'
Timing: Jan 18 2025 21:11:50
Script end

Main resources:

Total runtime1.4340 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.4609152.6406
Module start 'layout' 0.00580.0038 742.101639.4766
Module start 'content' 0.00971.4229 781.5781580.0234
Module end 'content' 1.43250.0014 1,361.601612.1250
Script end 1.4340  1,373.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2214160.0002
Check MTime0.00130.0894160.0001
Mysql Total
Database connection0.00070.049510.0007
Mysqli_queries1.386996.7183620.0224
Looping result0.00060.0441600.0000
Template Total1.398097.520.6990
Template load0.00190.134620.0010
Template processing1.396097.351120.6980
Template load and register function0.00020.010710.0002
states
state_id_array0.00130.087910.0013
state_identifier_array0.00310.215520.0015
Override
Cache load0.00160.1128210.0001
Sytem overhead
Fetch class attribute can translate value0.00050.034730.0002
Fetch class attribute name0.00120.081350.0002
XML
Image XML parsing0.00070.051330.0002
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00090.0609170.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs