Set up Confluence Cloud
Get the high-level details you need to set up your Confluence Cloud site in order to meet your team's needs.
The Table of Contents macro scans the headings on the current Confluence page to create a table of contents based on those headings. This helps readers find their way around lengthy pages, by summarizing the content structure, and by providing links to headings.
Any text formatted as a heading along with emojis, mentions, statuses, and dates are available for inclusion in your table of contents.
To add the Table of Contents macro:
When editing, select from the toolbar
Find the macro by name and select it
Configure it as needed
You can also type / on the page to bring up the same list you'd see by selecting from the toolbar. Continue typing the name of the macro to filter the list.
To edit the Table of Contents macro:
Select the macro placeholder.
Select the Edit icon to open the configuration panel.
Configure the parameters. Your changes are saved as you go.
Resume editing the page, and the panel closes.
You can also select the centered , medium-width , and full-width icons to adjust the width of some macros. Select the trashcan iconto remove the macro.
Parameters are options that you can set to control what and how content from the macro appears on the page.
If the parameter name used in Confluence Cloud storage format or wikimarkup is different than the label used when inserting macros using the browser or the slash command, it will be listed below in brackets (example).
Parameter | Default | Description |
---|---|---|
Output Type | list |
|
Display Section Numbering | clear | Select the check box to apply outline numbering to your headings, for example: 1.1, 1.2, 1.3. |
List Style | disc | Select the style of bullet point for each list item. You can use any valid CSS style. For example:
|
Heading Indent |
| Sets the indent for a list according to CSS quantities. Entering 10px will successively indent heading groups by 10px. For example, level 1 headings will be indented 10px and level 2 headings will be indented an additional 10px. |
Separator | brackets | This parameter applies to flat lists only. You can enter any of the following values:
|
Minimum Heading Level | 1 | 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 | 7 | 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. |
Include Headings |
| Filter headings to include according to specific criteria. You can use wildcard characters. If you only want the Overview and Summary headings to appear, enter Overview|Summary in this field. This field is case-sensitive. Enter both forms of the word if you want both instances to be included. |
Exclude Headings |
| Filter headings to exclude according to specific criteria. You can use wildcard characters. If the headings you want to exclude are Overview and Summary, enter Overview|Summary in this field. This field is case-sensitive. Enter both forms of the word if you want both instances to be excluded. |
Printable | checked | 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 <div> tags with the specified class attribute. |
Absolute URL |
| By default, the links in the TOC are relative URLs pointing to the current page. If checked, the links in the TOC will be full URLs. |
The examples below are based on this table of contents structure:
This example filters the headings to include those that contain 'Favorite', but excludes headings which end with 'Things'. The list is styled with Roman numerals.
Parameter | Value |
---|---|
List Style | upper-roman |
Include Headings | 1
Favourite.* |
Exclude Headings | 1
.*Things |
The resulting table of contents would be:
This example filters all headings to render a flat list of 'Unknowns' enclosed in square brackets (the default list style).
Parameter | Value |
---|---|
Output Type | flat |
Maximum Heading Level | 1
2 |
Include Headings | 1
Unknown.* |
The resulting table of contents would be:
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: toc
Macro body: None.
This example shows a list-type table of contents.
1
2
3
4
{toc:printable=true|style=square|maxLevel=2|indent=5px|minLevel=2|class=bigpink|exclude=[1//2]|type=list|outline=true|include=.*}
This example shows a flat table of contents.
1
2
3
4
{toc:printable=true|maxLevel=2|minLevel=2|class=bigpink|exclude=[1//2]|type=flat|outline=true|separator=pipe|include=.*}
When you use a Table of Contents macro in a template, you will see an error when you preview the template itself. But the Table of Contents macro works on the pages that people create from the template – the table of contents shows up after they have saved the page. (This is probably because the template is not defined as a page, and the Table of Contents macro works for pages only.)
The Table of Contents macro only displays page or blog post content. You can't use it to add a table of contents of headings in a comment for example.
The Table of Contents macro only works within the page, blog, or macro to which it has been added, and cannot reference or be referenced across multiple pages or blogs. When added to an Excerpt macro, for example, it will only display headings located inside the excerpt and those heading links won’t navigate to the source page.
Was this helpful?