tree
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.
| Other sources specific to this macro |
|---|
|
| Criterion | Result | Notes |
|---|---|---|
| D1 wording | OK | "Tree" is the usual word for a hierarchy shown as expandable nodes, the tree view of a file explorer. |
| D2 summary | KO | minor: 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 category | OK | the 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-action | KO | Quick 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 consistency | OK | compared 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-parameters | KO | the 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-example | OK | the 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 pattern | OK | compared 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-config | KO | minor: 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 instant | OK | static tree: inserting from the Quick Actions menu with "/tree" and Enter inserts the macro right away, with no dialog. |
| I4 cursor | KO | static 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 focus | OK | dynamic 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 wysiwyg | KO | in 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 errors | KO | invalid 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 nesting | KO | in 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-support | OK | the 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 empty | KO | static tree: the macro inserted by Quick Actions has no content area, only a placeholder that never receives the cursor, see I4. |
| E6 inplace | KO | static 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
| Parameter | C1 clarity | C2 mandatory | C3 defaults | C4 input-assistance | C5 groups | C6 order | C7 alternatives | C8 advanced | C9 technical | C13 constraints | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $content | KO | OK | N/A | OK | N/A | OK | N/A | N/A | N/A | N/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. |
| reference | KO | OK | OK | KO | KO | OK | OK | OK | OK | KO | 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. |
| root | KO | OK | OK | KO | KO | OK | N/A | OK | OK | KO | 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. |
| dragAndDrop | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| contextMenu | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| class | KO | OK | OK | OK | KO | OK | N/A | KO | OK | N/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. |
| icons | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| edges | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| links | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| checkboxes | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| openTo | KO | OK | OK | KO | KO | OK | N/A | OK | OK | KO | 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. |
| finder | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| showRoot | OK | OK | OK | OK | KO | OK | N/A | OK | OK | N/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. |
| limit | OK | OK | OK | KO | KO | OK | N/A | OK | OK | KO | 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. |
| exclusions | KO | OK | OK | KO | KO | OK | N/A | OK | OK | KO | 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.
| KO | Criterion | Existing tickets | New tickets |
|---|---|---|---|
| D2 | D2 summary | XWIKI-25470 | |
| D4 | D4 quick-action | XWIKI-25444 | |
| L2 | L2 doc-parameters | XINFRA-525 | |
| I2 | I2 zero-config | XWIKI-22046 (partial) | XWIKI-25513 |
| I4 | I4 cursor | XWIKI-25569 | |
| E1 | E1 wysiwyg | XWIKI-25523 (partial), XWIKI-25524 | |
| E2 | E2 errors | XCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25580 (partial) | |
| E3 | E3 nesting | XWIKI-23501 (partial) | XWIKI-25560 |
| E5 | E5 empty | XWIKI-25570 | |
| E6 | E6 inplace | XWIKI-25570 | |
| C1:$content | C1 clarity, $content | XWIKI-25470 | |
| C1:reference | C1 clarity, reference | XWIKI-25470 | |
| C4:reference | C4 input-assistance, reference | XWIKI-25566 | |
| C5:reference | C5 groups, reference | XWIKI-25472 | |
| C13:reference | C13 constraints, reference | XWIKI-25197 | |
| C1:root | C1 clarity, root | XWIKI-25470 | |
| C4:root | C4 input-assistance, root | XWIKI-25566, XWIKI-25565 (partial) | |
| C5:root | C5 groups, root | XWIKI-25472 | |
| C13:root | C13 constraints, root | XWIKI-25197 | |
| C5:dragAndDrop | C5 groups, dragAndDrop | XWIKI-25472 | |
| C5:contextMenu | C5 groups, contextMenu | XWIKI-25472 | |
| C1:class | C1 clarity, class | XWIKI-25470 | |
| C5:class | C5 groups, class | XWIKI-25472 | |
| C8:class | C8 advanced, class | XWIKI-25472 | |
| C5:icons | C5 groups, icons | XWIKI-25472 | |
| C5:edges | C5 groups, edges | XWIKI-25472 | |
| C5:links | C5 groups, links | XWIKI-25472 | |
| C5:checkboxes | C5 groups, checkboxes | XWIKI-25472 | |
| C1:openTo | C1 clarity, openTo | XWIKI-25470 | |
| C4:openTo | C4 input-assistance, openTo | XWIKI-25566, XWIKI-25565 (partial) | |
| C5:openTo | C5 groups, openTo | XWIKI-25472 | |
| C13:openTo | C13 constraints, openTo | XWIKI-25197 | |
| C5:finder | C5 groups, finder | XWIKI-25472 | |
| C5:showRoot | C5 groups, showRoot | XWIKI-25472 | |
| C4:limit | C4 input-assistance, limit | XWIKI-25182 (partial), XWIKI-25197 (partial) | XWIKI-25498 |
| C5:limit | C5 groups, limit | XWIKI-25472 | |
| C13:limit | C13 constraints, limit | XWIKI-25197 | |
| C1:exclusions | C1 clarity, exclusions | XWIKI-6061 (partial) | XWIKI-25470 |
| C4:exclusions | C4 input-assistance, exclusions | XWIKI-25566, XWIKI-25565 (partial) | |
| C5:exclusions | C5 groups, exclusions | XWIKI-25472 | |
| C13:exclusions | C13 constraints, exclusions | XWIKI-25197 |
Tickets
| Ticket | Origin | KOs covered | KOs partly covered |
|---|---|---|---|
| XWIKI-22046 | Existing | I2 | |
| XWIKI-25182 | Existing | C4:limit | |
| XWIKI-25197 | Existing | C13:exclusions C13:limit C13:openTo C13:reference C13:root | C4:limit |
| XWIKI-6061 | Existing | C1:exclusions | |
| XCOMMONS-3847 | New | E2 | |
| XRENDERING-823 | New | E2 | |
| XWIKI-25444 | New | D4 | |
| XWIKI-25470 | New | C1:$content C1:class C1:openTo C1:reference C1:root D2 C1:exclusions | |
| XWIKI-25472 | New | C5: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-25498 | New | C4:limit | |
| XINFRA-525 | New | L2 | |
| XWIKI-25513 | New | I2 | |
| XWIKI-25523 | New | E1 | |
| XWIKI-25524 | New | E1 | |
| XWIKI-23501 | Existing | E3 | |
| XWIKI-25560 | New | E3 | |
| XWIKI-25566 | New | C4:reference C4:root C4:openTo C4:exclusions | |
| XWIKI-25565 | New | C4:root C4:openTo C4:exclusions | |
| XWIKI-25569 | New | I4 | |
| XWIKI-25570 | New | E6 E5 | |
| XWIKI-25580 | New | E2 |
Known issues of this macro
No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.
Lucas Charpentier