{tree 'menu'} renders its content - the body - once for every top row, like any data tag. The difference is inside the body: {recurse} renders that same body again for the children of the current row, each child a row of its own, and so on down to any depth. Menus, category trees, folder listings and threaded comments are all one body written once.

The children of a row are the array in its children field; the children='items' option names another field, used at every depth. A row without children - the field missing or empty - renders nothing at its {recurse}. {branch} ... {/branch} renders only for a row that has children, so the <ul> around a {recurse} is left out for a leaf, and its @else@ part renders for a leaf instead.

Every list of the tree is a level named as the tree is: depth@tree is 1 for the top rows and one more per level down, and first@tree, current@tree, count@tree speak of the list being rendered. The handling options sort, where and reverse written on the tree apply to every list, the children included. The @else@ part of the tree itself shows when there are no rows at all.

Under the strict syntax check a tree without rows named, a name nothing holds, or a tree without its closing tag is an error.