[All Adaptavist Apps]
This tutorial shows you how to use the Macros to automatically generate self-updating menus...
There are three scenarions where you might want to automate the structure of your menus:
If any of those describe you, read on
But first, there are some scenarios where you might want to avoid automating menus:
So, assuming that you still want to automate your menus, let's begin...
You can use any macro that outputs an un-ordered bullet list of items within a menu. Let's take a look at two of them...
This is by far the most common macro to make it's way in to the menu settings:
* [Builder] {children}
The [children macro] basically creates a bulleted list of child pages from a given starting point. The example shown above would look something like this if you put it on a page:
As you can see, there's no other items showing - that's because this page doesn't have any children. However, if we were on a page with children then the list would be generated.
To ensure that children are listed from a specific starting point, use the page parameter as follows:
* [Builder] {children:page=Builder}
Which would give:
Voila! That's exactly
Well, not quite. We use the depth=2 parameter of the [children macro] to automaticall create sub-menus for any pages that themeselves have children.
how the Builder menu and most other menus are created at the top of pages in this user guide.
The [incoming-links macro] lists pages that link to the current page. As such, if you're on a page that nothing links to, it won't output anything
The [incoming-links macro] actually allows you to specify what to output if there are no incoming links:
{incoming-links:style=disc}* No incoming links{incoming-links}
. However, as something does link to this page, we will get some output:
* [Automated Menu Creation] {incoming-links:style=disc}{incoming-links}
As you can see, this macro needs to be told to output as a bulleted list (by default it outputs with icons, but not the sort that are usable in the menu) and because the macro can have a body we've had to include the closing tag as well.
On screen, for this specific page, the macro would display:
While writing this tutorial, I got a bit carried away playing around with other macros and thus the Navigate menu (at the top of all pages in this user guide) was born.
Here's how it was made:
* Navigate ** Incoming Links {incoming-links:style=disc}* No incoming links{incoming-links} ** Child Pages {children} ** ---- ** Page Headings {toc:style=disc|maxLevel=5}
Have fun!