Forums / Setup & design / Show the children of a folder

Show the children of a folder

Author Message

Christian Lundvang

Friday 26 September 2003 12:43:56 am

Hi.

Somebody who can help me with this?

I have a folder with many subnodes, wich has more subnodes. Like this:

Folder 1
--folder
--folder
---article
----article
-----article
Folder 2
etc...
Is it possible to count all the subnodes of folder 1, and then the subnodes of folder 2?

Thanks in advance

--
Best Regards
Christian Lundvang
http://www.nxc.no

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.