Show the children of a folder

Show the children of a folder

Friday 26 September 2003 12:43:56 am - 2 replies

Author Message

Vivienne van Velzen

Monday 29 September 2003 11:56:24 pm

Hi Christian,

If you just want to count all the subnodes, you could use the fetch command with list_count, like this:

{let xx=fetch(content, list_count, hash(parent_node_id, $folder1.node_id))}

In the example you gave, $xx now has the value 5 (2 folders and 3 articles).
The same could be done for folder 2.
If you just want to count the articles, you'll have to limit your fetch with i.e. a class_filter. If your folders have class id 1, you could try the following:

{let xx=fetch(content, list_count, hash(parent_node_id, $folder1.node_id, class_filter_type, include, class_filter_array, array(1)))}

$xx then has the value 3 (3 articles in the folder Folder1 and the folders with class id 1).

Hope this helps,

Vivienne

Paolo Tramontani

Tuesday 30 September 2003 1:47:09 am

Hi Christian,
if your subnodes are nested in different sublevel (i.e. article is children of folder and folder is children of folder1) you have to user tree_count instead of list_count in the fetch function:
{let list_count=fetch( 'content', 'tree_count', hash( ... ) )}
All the rest remain the same.

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.