The Table of Contents Zone macro enables you to mark out a 'page zone' from which you can use the headings to create a table of contents. Styling the headings as a flat list enables you to enclose the page text by top and bottom navigation bars similar to web navigation. When styled as a list, headings are indented progressively.
On this page:
To insert the Pagetree macro into a page using the Macro Browser,
|
Once you've found the Pagetree macro and have added the required parameter values, click 'insert' to add it to your page. |
Include the following markup in your page:
{toc-zone:type:=[list,flat]|maxLevel=1}
Content in the zone, including other macros and page content.
{toc-zone}
|
There are more examples below.
Parameter |
Required? |
Default |
Description |
|
|---|---|---|---|---|
Location |
no |
both |
Use this parameter to specify whether the output list displays at the top, at the bottom, or encloses the page zone content. By default, the macro displays headings at both the top and the bottom of the page. |
|
Output Type |
no |
list |
Set this to "list" or "flat". Selecting list produces a typical list type TOC. Selecting flat produces a horizontal menu-type series of links, for example: [Heading 1] [Heading 2] [Heading 3]. |
|
Display Section Numbering |
no |
false |
Select the tick box to apply outline numbering to your headings, for example: 1.1, 1.2, 1.3. |
|
List Style |
no |
none |
Use this parameter to select the style of bullet point for each list item. You can use any valid CSS style. For example:
|
|
Separator |
no |
brackets |
This parameter applies to "flat" lists only. Use this parameter to style the display of a "flat" or horizontal list. You can enter any of the following parameters:
|
|
Indent |
no |
|
Use this parameter to style the indent for a "list" according to CSS quantities, entering "10px" will successively indent list heading groups 10px. For example, h1 headings will be indented 10px and h2 headings will be indented an additional 10px. |
|
Minimum Heading Level |
no |
1 |
Use this parameter to select the heading level to start your TOC list. For example, 2 will list h2, h3, and h4 headings, but will not include h1 headings. |
|
Maximum Heading Level |
no |
7 |
Use this parameter to select the maximum heading levels to include. For example, 2 will list h1 and h2, but will not include h3 and below. |
|
Include Headings |
no |
|
Use this parameter as a way of filtering to include headings according to specific criteria. You can use wildcard characters to filter the headings. See Sun's Regex documentation for examples of constructing regular expression strings.
|
|
Exclude Headings |
no |
|
Use this parameter as a way of filtering to enclude headings according to specific criteria. You can use wildcard characters to filter the headings. See Sun's Regex documentation for examples of constructing regular expression strings.
|
|
Printable |
no |
true |
By default, the TOC is set to print. If you set this parameter to |
|
CSS Class Name |
no |
|
If you have a custom TOC in your CSS style sheet, you can use this parameter to output the TOC with the specified "class" attribute. |
The examples are based on a page with the following headings:
h1. Places h2. Favourite Places h2. Unknown Places h1. Foods h2. Favourite Foods h2. Unknown Foods h1. Things h2. Favourite Things h2. Unknown Things |
This will display only level 1 headings as a numbered list at the top of the page.
{toc-zone:type|location=top|type=flat|maxLevel=1}
h1. Places
h2. Favourite Places
h2. Unknown Places
h1. Foods
h2. Favourite Foods
h2. Unknown Foods
h1. Things
h2. Favourite Things
h2. Unknown Things
{toc-zone} |
This example will filter all headings to include those that contain "Favourite", but will exclude any heading which ends with the word "Things'. The list is styled with Roman numerals. It will not display on the printed page.
{toc-zone:minLevel=2|maxLevel=4|exclude=Adding your own Tip}
Page zone content
{toc-zone} |
You can see this example 'live by visiting the Tips via Twitter page.
This will filter all headings to render a flat list of 'Unknowns' enclosed in square brackets.
{toc:type=flat|maxLevel=2|include=Unknown.*} |
Screenshot: Filtered TOC 'zone' headings displayed as flat list
<h2><a name="pagename-headingname"></a>Heading Name</h2> |
Table of Contents Macro
Pagetree Macro
Adding a Navigation Sidebar
Working with Macros
Take me back to the Confluence User's Guide.