The Page Tree macro displays a dynamic, hierarchical list of pages starting from a specified parent (root) page. It can act as a table of contents or a list of related topics. When viewing the page tree, your reader can click a link to view the relevant page. The page's current position is highlighted in the page tree.
To add the Page Tree macro to a page:
- In the Confluence editor, choose > Other Macros
- Find and select the required macro
Speeding up macro entry with autocomplete:
- In the new editor - Type / and the beginning of an element (tool or things in the insert menu) to see a list of suggestions.
- In the legacy editor - Type { and the beginning of the macro name to see a list of suggested macros.
Details are in Keyboard shortcuts, markdown, and autocomplete.
To edit an existing macro
Click the macro placeholder and choose Edit. A macro dialog window will open, where you can edit the parameters of the macro.
Click Refresh in the Macro Browser to see the effect of changes to the macro parameters.
Macro Parameters
Parameters are options that you can set to control the content or format of the macro output. Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the macro browser, it will be listed below in brackets (example
).
Parameter | Default | Description |
---|---|---|
Root Page | The home page of the space | Specify the parent page for the page tree. The tree will include all children of the given page, plus their children and grand-children etc. The tree will not include the root page itself.
|
Sort Pages By | position | Specify the order to display the pages in the tree. This sort order is for display purposes only. It does not permanently re-arrange the page order. The value may be one of the following:
|
Include Excerpts in Page Tree | false | Select if you want the page tree to show excerpts from each page. The excerpts must be defined on each page by the Excerpt macro. |
Reverse Order | false | Select to show the pages in reverse (descending) natural order. Must be used in combination with the Sort Pages By parameter. |
Include Search Box above Page Tree | false | Select if you want to include a search box above the page tree. The search box allows your readers to search within the page tree for the specified value. |
Show Expand/Collapse Links | false | Select if you want to display the 'expand all' and 'collapse all' links at the top of your page tree. Your readers can click these links to open or close all branches of the tree at once. Available values in wikimarkup and storage format:
|
Start Depth | 1 | Enter any number greater than 0 to set how many levels of children the tree should show when it opens for the first time. |
Wiki markup example
Wiki markup is only supported in the legacy editor.
Wiki markup is useful when you need to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.
Macro name: pagetree
Macro body: None.
{pagetree:root=Page Name|sort=natural|excerpt=true|reverse=false|startDepth=3|expandCollapseAll=true|searchBox=true}