GetFolderTreeIDS (open)

Returns an array of folder IDs from the root to the specified folder

Syntax

LOADLIB "mod::publisher/lib/publisher.whlib";

INTEGER ARRAY FUNCTION GetFolderTreeIDS(INTEGER folderid)

Parameters

INTEGER folderid

ID of the folder towards which a tree should be created

Return value

INTEGER ARRAY

An integer array of folder IDs representing every folder in the path.

Description

This function returns a path of folder IDs, starting with the root folder of the site, and ending with the specified folder. The function can be used to create navigation trees.

Examples

// Uses an array of folder IDs and prints the complete path up
// to folder with ID=30
INTEGER ARRAY AllFolders := GetFolderTreeIDs(30);
FOREVERY (INTEGER ThisFolder FROM AllFolders)
{
  RECORD FolderRecord := GetFolder (ThisFolder);
  PRINT(FolderRecord.NAME || "<br>");
}