The Table of Contents macro scans the headings of the current Confluence page to dynamically create a table of contents from your page headings. This helps readers navigate lengthy pages by summarising the content structure and providing links to headings. Headings are indented progressively.
Using the Table of Contents Macro
To add the Table of Contents macro to a page:
Speeding up macro entry with autocomplete: To edit an existing macro: Click the macro placeholder and choose Edit. This will display the parameters of the macro in the Macro Browser.
Speeding up macro entry with autocomplete:
To edit an existing macro: Click the macro placeholder and choose Edit. This will display the parameters of the macro in the Macro Browser.
You can also add the macro to a page by choosing Insert > Table of Contents from the editor toolbar.
Parameters are options that you can set to control the content or format of the macro output.
Display Section Numbering
Select the check box to apply outline numbering to your headings, for example: 1.1, 1.2, 1.3.
Select the style of bullet point for each list item. You can use any valid CSS style. For example:
Sets the indent for a list according to CSS quantities. Entering
This parameter applies to flat lists only. You can enter any of the following values:
Minimum Heading Level
Select the highest heading level to start your TOC list. For example, entering 2 will include levels 2, and lower, headings, but will not include level 1 headings.
Maximum Heading Level
Select the lowest heading level to include. For example, entering 2 will include levels 1 and 2, but will not include level 3 headings and below.
Filter headings to include according to specific criteria. You can use wildcard characters. See Sun's Regex documentation for examples of constructing regular expression strings.
Filter headings to enclude according to specific criteria. You can use wildcard characters. See Sun's Regex documentation for examples of constructing regular expression strings.
|By default, the TOC is set to print. If you clear the check box, the TOC will not be visible when you print the page.|
CSS Class Name
If you have custom TOC styles in your CSS style sheet, use this parameter to output the TOC inside
The examples below are based on this table of contents:
Filtered Table of Contents
This example filters the headings to include those that contain 'Favourite', but excludes headings which end with 'Things'. The list is styled with Roman numerals.
The resulting table of contents is:
This example filters all headings to render a flat list of 'Unknowns' enclosed in square brackets (the default list style).
|Maximum Heading Level|
The resulting table of contents is:
- Due to an outstanding issue in the Table of Contents macro (CONF-10619), the Macro Browser's Refresh function does not render any parameter modifications. Currently, the rendering of parameter value modifications to the Table of Contents macro occurs only after the page is saved.
Using HTML Heading Markup with the Table of Contents Macro
The Table of Contents macro cannot handle HTML heading markup on its own. Hence, if you use the HTML and HTML Include macros to render HTML heading markup in a Confluence page, the Table of Contents macro will not create a contents list out of these headings. (For more information about this issue, please refer to TOC-93.)
However, if you insert an HTML anchor into each HTML heading on your page (based on the following syntax), the Table of Contents macro will incorporate these headings into your contents list.
The syntax for the anchor name is the page name and heading name separated by a hyphen, in which the page and heading names have all spaces removed and are converted to lowercase. If punctuation marks occur within a page or heading name, each mark should usually be converted to its URL escape code in the anchor name.
Take me back to the Confluence User's Guide.