API docs     >     Pages and Sites     >     Templates

Templates->getTree

Description

getTree ( $templateId = NULL, $maxLevels = 2 )
Gets the Template Tree

Parameters

$templateId
int
(optional) From which Template Id the tree should be returned
$maxLevels
int
(optional) Specifies the maximum level of nodes to get

Returns

array
Template tree
  1. Array(                              array Array of n Templates
  2.     [0] => Array(
  3.         [ID] => 5                   int Id
  4.         [LFT] => 9                  int Id of the left node in the nested set tree structure
  5.         [RGT] => 8                  int Id of the right node in the nested set tree structure
  6.         [VERSIONPUBLISHED] => 0     int Published version (either a specific version or 999999 if set to 'ALWAYS_LATEST_APPROVED_VERSION')
  7.         [TITLE] => ''               string Title
  8.         [LEVEL] => 1                int Level in tree
  9.         [PARENT] => 0               int Parent Id
  10.         [PNAME] => 'template_1      string Permanent name
  11.         [FOLDER] => 0               int 1 if folder, 0 if not
  12.         [RREAD] => 1                int 1 if User owns Permissions to read this Object, 0 if not
  13.         [RWRITE] => 1               int 1 if User owns Permissions to write this Object, 0 if not
  14.         [RDELETE] => 1              int 1 if User owns Permissions to delete this Object, 0 if not
  15.         [RSUB] => 1                 int 1 if User owns Permissions to create subnodes under this Object, 0 if not
  16.         [NAME] => 'Template 1'      string Name
  17.     )
  18.     ...
  19. )