Forums / Setup & design / fetch( 'content', 'list_count' - does not work

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