Forums / Developer / Problem with ezcontentobject.children_count (children[] too)

Problem with ezcontentobject.children_count (children[] too)

Author Message

Tristan Koen

Wednesday 20 August 2003 5:25:55 am

I am using the following code to display only objects that have children. It is used recursively to dynamically display a tree structure on one of my pages.

{let items=fetch('content',tree,hash(parent_node_id, $node.node_id))}
{section show=ne($:items.children_count,"0")}
<ul>
{section name=Child loop=$items}
<li>{node_view_gui view=line content_node=$:item}</li>
{/section}
</ul>
{/section}
{/let}

I have also tried
{section show=$:items.children}
{section show=$:items.children_count}

I just can't get it to not display items without children. All I get are the following errors:

Error: eZTemplate Aug 20 2003 14:25:36
No such attribute for array(2): children_count
Choose one of following: 0, 1

Can anybody explain why
1. I am getting these messages
2. How I correct my code so that it works

Thanks