"tree" Macro

Last modified by Lucas Charpentier on 2026/11/12 15:15

Reference

Description

The tree macro displays a nested list as a tree whose nodes the reader opens and closes.

This page covers the trees written by hand in the macro content. The macro can also load its nodes on demand from a script: see the developer reference of the "tree" macro. To display the pages of the wiki, use the "documentTree" macro instead.

Usage

{{tree}}
* First node
** Child node
* Second node
{{/tree}}

In the WYSIWYG editor the macro is listed as "Tree", in the Navigation category.

The macro is standalone only. Three behaviours are worth knowing before you use it:

  • the tree is displayed closed, showing only the first level of the list;
  • a node label can be a link, but it only looks and behaves as one when links is set to true;
  • in the WYSIWYG editor, a tree without content displays a placeholder message until a list is written in it.

Parameters

NameMandatoryAllowed ValuesDefault ValueDescription
contentnowiki syntaxnoneA nested unordered list. Each item is a node, and the items nested under it are its children.
checkboxesnotrue, falsefalseWhether to display a checkbox in front of each node, to let the reader select several nodes.
edgesnotrue, falsetrueWhether to display the lines connecting the nodes.
findernotrue, falsefalseWhether to display a search field above the tree. It suggests nodes as the reader types and opens the tree to the selected one.
iconsnotrue, falsetrueWhether to display an icon in front of each node.
linksnotrue, falsefalseWhether the node labels written as links look and behave as links.

The other parameters of the macro concern the trees loaded from a script. They are described in the developer reference.

Examples

Display a List as a Tree

{{tree}}
* Fruits
** Apples
** Pears
* Vegetables
** Carrots
* Sandbox
{{/tree}}

Here the reader has opened the Fruits node:

A tree of three nodes, Fruits, Vegetables and Sandbox, with Fruits opened on Apples and Pears

Use Links as Node Labels

{{tree links="true"}}
* [[Sandbox>>Sandbox.WebHome]]
** [[XWiki>>https://www.xwiki.org]]
{{/tree}}

Related

Get Connected