tree

Last modified by Lucas Charpentier on 2026/10/27 10:30

Audit

Macro ID
tree
Source
XS
Type
Special
Classification reason
The macro has two use cases. A static tree, the first examples of the documentation, has a content and no Reference: it turns the nested list the user types into a tree, so most of its output is typed content, a wrapper use. A dynamic tree has a Reference and usually no content: it loads its nodes from a tree source, like the uses in XWiki Standard, a generator use. The wrapper criteria I3, I4, E5 and E6 are checked on the static tree, I5 on the dynamic tree. Several parameters only make sense for one use case, which hints that the two could be separate macros.
Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-19
Auditor
Compared macros
menu container

Sources

Where to gather the information the criteria are checked against, see Gather the sources.

SourceWhat it givesUsed forWhere
DocumentationParameters, default values and examples, including the most common exampleL2, L3, and the criteria measured with the most common examplehttps://extensions.xwiki.org/xwiki/bin/view/Extension/Tree%20Macro#HWikiMacro
Source codeHow the macro declares its parameters and content: types, groups, features, advanced and hidden flags, constraints, content type, inline supportC4, C5, C7, C8, C9, C13, E4, E6https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-18.8.0/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-macro/src/main/resources/Macros/Tree.xml
Macro descriptorWhat the Edit Macro dialog is built from, on design.xwiki.orgD1, D2, C1 to C9, E4Descriptor, list of macros with their categories
TranslationsThe name, description and parameter names in each languageD1, D2, D4, C1l10n.xwiki.org
Uses in XWiki pagesHow XWiki itself uses the macro, a realistic example when the documentation has noneL3, C2, C3, C6, C8, C9Search the xwiki organization on GitHub
Compared macrosThe audits of the macros of the same typeL1, D3menu, container
Other sources specific to this macro
  • tree_macros.vm, xwiki-platform: the defaults of the tree options, the boolean options read as true only for the value "true", the parameters only passed to a dynamic tree source, and the Class parameter replacing the default xtree class.
  • TreeTranslations.xml: the name, description and parameter texts; exclusions has no translation key, so its name is its ID in every language.
  • Uses in XWiki Standard: only dynamic trees, {{tree reference="XWiki.DocumentTree"/}} in the macro page and the VFS tree macro; the Page Tree macro uses the tree Velocity macro instead.
  • documentTree audit: the Page Tree macro, built on the same tree widget, shares root, openTo, finder, showRoot, limit and exclusions.
CriterionResultNotes
D1 wordingOK"Tree" is the usual word for a hierarchy shown as expandable nodes, the tree view of a file explorer.
D2 summaryKOminor: the description "Displays a tree hierarchy defined by the macro content or the source parameter." names a "source" parameter that does not exist, the parameter is Reference, and "tree hierarchy" mostly repeats the name: it does not say that the tree shows a nested list as nodes that expand and collapse on click.
D3 categoryOKthe macro is in Navigation, like menu, Page Tree and children. The compared macro container is in Layout, but a tree of links is navigation first, the same choice as for menu.
D4 quick-actionKOQuick Actions finds the macro first for "tree", for the French name "Arbre" and for the synonym "hierarchy". The synonyms "outline", "collapsible", "nested list" and "folders" do not find it: "nested list" only gives Bulleted List.
L1 consistencyOKcompared with menu and container. Like container, the content is optional and the Quick Action inserts the macro right away, with no dialog; menu has a mandatory content and opens the Edit Macro dialog. Like menu, the content is a regular nested bulleted list, which the editor can create, not a format of its own. The defaults of the boolean parameters and of limit are declared. Unlike both, the macro has a second mode, a dynamic tree loaded from the Reference parameter, which is by design.
L2 doc-parametersKOthe parameters are documented only on the legacy page Tree Macro, not in the new documentation. That page does not document the content nor exclusions, and its description of root, which depends on showRoot, differs from the one of the macro.
L3 doc-exampleOKthe first Static Tree example of the documentation, {{tree}} * Grandparent ** Parent *** Child {{/tree}} , shows the most common use and renders without error. The other examples also render without error.
I1 patternOKcompared with warning, the reference wrapper: both are inserted by their Quick Action without a dialog, and through the Insert Macro dialog with an Edit Macro dialog whose fields are all optional.
I2 zero-configKOminor: Quick Actions inserts {{tree/}} , and the Edit Macro dialog submitted with the default values {{tree}}{{/tree}} : view mode shows nothing at all, with no error and no message. The editor has a dedicated placeholder, but it has two problems: right after the insertion it shows the generic "macro:tree", and the dedicated one only once the page is reopened; and that one, "This tree can't be displayed in edit mode.", does not say that the tree is empty nor how to fill it.
I3 instantOKstatic tree: inserting from the Quick Actions menu with "/tree" and Enter inserts the macro right away, with no dialog.
I4 cursorKOstatic tree: after the Quick Actions insertion, the macro has no content area: typed text goes outside the macro. To add nodes the user has to open the Edit Macro dialog and type a wiki syntax list in the Content text area.
I5 focusOKdynamic tree: the macro has no mandatory parameter, so it is OK by the decision on I5. Reference, the parameter a dynamic tree needs, is in the single group of 15 fields, see C5 and C6.
E1 wysiwygKOin the editor, the example shows a plain nested bulleted list with every level expanded, while view mode shows a tree with a folder icon on every node, collapsed to its first level, whose nodes expand on click. The tree is built by JavaScript that does not run in the editor. To reproduce: insert {{tree}} * Grandparent ** Parent *** Child {{/tree}} and compare the editor with view mode. An empty tree gets a dedicated placeholder, see I2.
E2 errorsKOinvalid values are accepted silently, with no message. A boolean parameter with any value other than "true" is read as false, so {{tree icons="maybe"}}* A{{/tree}} hides the icons and {{tree checkboxes="yes"}}* A{{/tree}} shows no checkbox. {{tree reference="XWiki.DocumentTree" limit="abc"/}} renders the default tree. {{tree reference="NoSuchSpace.NoSuchTree"/}} renders nothing: the macro reads its nodes from that page, so the editor could show that the page does not exist and propose to create it. A content that is not a bulleted list, like {{tree}}Some text{{/tree}} , a table or a numbered list, renders nothing in view mode, with no message, although the editor shows it.
E3 nestingKOin a list item and in a table cell, like * {{tree}}* A{{/tree}} , the macro is inline and renders "The [tree] macro is a standalone macro and it cannot be used inline." in the editor and in view mode. In a box it renders. A table or a box inserted in its content, like {{tree}}{{box}}Text{{/box}}{{/tree}} , is shown in the editor but silently dropped in view mode, and a box in a list item of the content, like {{tree}}* Item ** ((({{box}}Sub box{{/box}}))){{/tree}} , leaves only "Item".
E4 inline-supportOKthe macro does not declare inline support, and its output, a tree of nested nodes, is a block: the missing declaration has a technical reason.
E5 emptyKOstatic tree: the macro inserted by Quick Actions has no content area, only a placeholder that never receives the cursor, see I4.
E6 inplaceKOstatic tree: the content is not edited in place: the example shows as a list in the editor that cannot be edited, and the content can only be changed in the plain text area of the Edit Macro dialog, in wiki syntax.

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
$contentKOOKN/AOKN/AOKN/AN/AN/AN/A

C1: the description "You can use nested HTML unordered lists to describe the tree structure. See http://www.jstree.com/docs/html/ for more information." speaks of HTML and of the jsTree library, while the user types a wiki syntax bulleted list, and does not say that anything other than a bulleted list, like a paragraph, a table or a numbered list, is dropped, see E2.

C4: edited only in the plain text area of the Edit Macro dialog, recorded under E6.

referenceKOOKOKKOKOOKOKOKOKKO

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

C1: "Reference" does not say that it is the page providing a dynamic tree, and the description uses technical terms, "resource", "URL/path", without saying that a URL needs the "path:" prefix, which only the documentation gives.

C4: a plain text field for a page reference, where a page picker could be used.

C7: an alternative to the content, a dynamic tree instead of a static one: only parameters can be part of a feature, see the Cross-macro findings.

C13: the accepted format depends on the tree source, a page reference or a "path:" URL for Reference, a node id like document:xwiki:Main.WebHome for Root and Open to, and the macro declares none: the wiki macro parameters cannot declare a format, see XWIKI-25197 in the Cross-macro findings. A format that changes with the use case hints that the static and dynamic trees could be two macros.

rootKOOKOKKOKOOKN/AOKOKKO

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

C1: "root node id" is technical, and the description does not give the format of a node id, like document:xwiki:Main.WebHome, nor that it only works with a dynamic tree. It also says the root node is not displayed, while showRoot can display it.

C4: a plain text field for a node id, where a node picker, like the Root field of Page Tree, could be used. The picker would depend on the tree source, another hint that the static and dynamic trees could be two macros.

C13: the accepted format depends on the tree source, a page reference or a "path:" URL for Reference, a node id like document:xwiki:Main.WebHome for Root and Open to, and the macro declares none: the wiki macro parameters cannot declare a format, see XWIKI-25197 in the Cross-macro findings. A format that changes with the use case hints that the static and dynamic trees could be two macros.

dragAndDropOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

contextMenuOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

classKOOKOKOKKOOKN/AKOOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

C1: the parameter looks like the cssClass of other macros, such as box, container or code, but it is named differently and does something different: the description says the classes are added, while they replace the default xtree class, so {{tree class="foo"}}* A ** B{{/tree}} renders a plain bulleted list instead of a tree, see tree_macros.vm. Name and behavior should be aligned with cssClass.

C8: a styling parameter that most trees do not set, not marked as advanced.

iconsOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

edgesOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

linksOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

checkboxesOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

openToKOOKOKKOKOOKN/AOKOKKO

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

C1: "The id of the node" is technical, and the description does not give the format of a node id nor how to give one to a node of a static tree.

C4: a plain text field for a node id, where a node picker, like the Open to field of Page Tree, could be used. The picker would depend on the tree source, another hint that the static and dynamic trees could be two macros.

C13: the accepted format depends on the tree source, a page reference or a "path:" URL for Reference, a node id like document:xwiki:Main.WebHome for Root and Open to, and the macro declares none: the wiki macro parameters cannot declare a format, see XWIKI-25197 in the Cross-macro findings. A format that changes with the use case hints that the static and dynamic trees could be two macros.

finderOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

showRootOKOKOKOKKOOKN/AOKOKN/A

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

limitOKOKOKKOKOOKN/AOKOKKO

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

C4: a plain text field where any text can be typed, while the value is a number of child nodes, which a number field would fit.

C13: the macro is a wiki macro, whose parameters cannot declare a range or a format, see XWIKI-25197 in the Cross-macro findings.

exclusionsKOOKOKKOKOOKN/AOKOKKO

C5: the only group, Optional parameters, holds the 15 fields of the dialog, content included, above 7 ± 2, in alphabetical order, mixing the display options of every tree with the parameters that only work with a dynamic tree.

C1: the name is the parameter ID, "exclusions", in every language, since the parameter has no translation key, and the description, left in English, does not give the format of a node id.

C4: a plain text field for a list of node ids, where a node picker with several values could be used. The picker would depend on the tree source, another hint that the static and dynamic trees could be two macros.

C13: the macro is a wiki macro, whose parameters cannot declare a range or a format, see XWIKI-25197 in the Cross-macro findings.

Other notes

The two use cases change several parameters drastically: Reference, Root, Open to, Exclusions and Limit only work with a dynamic tree, and the format of the node ids depends on the tree source, see C4 and C13 of these parameters. Two macros, one for a static tree and one for a dynamic tree, would give each a dialog with only its own fields.

KOs and tickets

Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.

KOCriterionExisting ticketsNew tickets
D2D2 summaryXWIKI-25470
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXINFRA-525
I2I2 zero-configXWIKI-22046 (partial)XWIKI-25513
I4I4 cursorXWIKI-25569
E1E1 wysiwygXWIKI-25523 (partial), XWIKI-25524
E2E2 errorsXCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25580 (partial)
E3E3 nestingXWIKI-23501 (partial)XWIKI-25560
E5E5 emptyXWIKI-25570
E6E6 inplaceXWIKI-25570
C1:$contentC1 clarity, $contentXWIKI-25470
C1:referenceC1 clarity, referenceXWIKI-25470
C4:referenceC4 input-assistance, referenceXWIKI-25566
C5:referenceC5 groups, referenceXWIKI-25472
C13:referenceC13 constraints, referenceXWIKI-25197
C1:rootC1 clarity, rootXWIKI-25470
C4:rootC4 input-assistance, rootXWIKI-25566, XWIKI-25565 (partial)
C5:rootC5 groups, rootXWIKI-25472
C13:rootC13 constraints, rootXWIKI-25197
C5:dragAndDropC5 groups, dragAndDropXWIKI-25472
C5:contextMenuC5 groups, contextMenuXWIKI-25472
C1:classC1 clarity, classXWIKI-25470
C5:classC5 groups, classXWIKI-25472
C8:classC8 advanced, classXWIKI-25472
C5:iconsC5 groups, iconsXWIKI-25472
C5:edgesC5 groups, edgesXWIKI-25472
C5:linksC5 groups, linksXWIKI-25472
C5:checkboxesC5 groups, checkboxesXWIKI-25472
C1:openToC1 clarity, openToXWIKI-25470
C4:openToC4 input-assistance, openToXWIKI-25566, XWIKI-25565 (partial)
C5:openToC5 groups, openToXWIKI-25472
C13:openToC13 constraints, openToXWIKI-25197
C5:finderC5 groups, finderXWIKI-25472
C5:showRootC5 groups, showRootXWIKI-25472
C4:limitC4 input-assistance, limitXWIKI-25182 (partial), XWIKI-25197 (partial)XWIKI-25498
C5:limitC5 groups, limitXWIKI-25472
C13:limitC13 constraints, limitXWIKI-25197
C1:exclusionsC1 clarity, exclusionsXWIKI-6061 (partial)XWIKI-25470
C4:exclusionsC4 input-assistance, exclusionsXWIKI-25566, XWIKI-25565 (partial)
C5:exclusionsC5 groups, exclusionsXWIKI-25472
C13:exclusionsC13 constraints, exclusionsXWIKI-25197
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-22046ExistingI2
XWIKI-25182ExistingC4:limit
XWIKI-25197ExistingC13:exclusions C13:limit C13:openTo C13:reference C13:rootC4:limit
XWIKI-6061ExistingC1:exclusions
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25444NewD4
XWIKI-25470NewC1:$content C1:class C1:openTo C1:reference C1:root D2 C1:exclusions
XWIKI-25472NewC5:checkboxes C5:class C5:contextMenu C5:dragAndDrop C5:edges C5:exclusions C5:finder C5:icons C5:limit C5:links C5:openTo C5:reference C5:root C5:showRoot C8:class
XWIKI-25498NewC4:limit
XINFRA-525NewL2
XWIKI-25513NewI2
XWIKI-25523NewE1
XWIKI-25524NewE1
XWIKI-23501ExistingE3
XWIKI-25560NewE3
XWIKI-25566NewC4:reference C4:root C4:openTo C4:exclusions
XWIKI-25565NewC4:root C4:openTo C4:exclusions
XWIKI-25569NewI4
XWIKI-25570NewE6 E5
XWIKI-25580NewE2

Known issues of this macro

No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.

Get Connected