You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

The {pagetree} macro is a handy hierarchical browser of all the pages in your wiki. It's a great way to provide an interactive table of contents. By default it presents a view of all the child pages of your home page. Clicking the plus sign next to an item expands it to show its children without leaving the page you're on. Just click a title to go to the page.

There is also an option in the macro for expanding or collapsing all children.

Here's my favorite macro expression which I use on my wikis. The root=@self parameter sets the root at the current page. You can substitute a page name for @self here instead if you want. If you don't specify a root, it sets the home page as root by default.

{pagetree:root=@self|expandCollapseAll=true}


Screenshot of rendered {pagetree} macro

Here are all the macro parameters you can control:

  • root: - (optional) page where the tree would be rooted from. Meta root names @self, @parent, @home can also be used.
  • sort: - (optional) sorts the tree node. It my be one of the following: bitwise, creation, modified, natural, position. Default sorting is position
  • excerpt: - (optional) true/false flag that indicate if a page excerpt would be included in the tree display (default is false).
  • reverse: - (optional) true/false flag that allows you to reverse the order of the display (default is false).
  • searchBox: - (optional) true/false flag that allows you to add a search box in the tree that would search from the root page (default is false).
  • expandCollapseAll: - (optional) true/false flag that allows you to add an expand all and a collapse all row (default is false).
  • startDepth: - (optional) a number that indicates the initial depth that the tree would display (default value is 1).
  • No labels