• Products
  • Documentation
  • Resources

Insert the table of content zone macro

You can use the Table of Content Zone macro to mark out a section (zone) within the page from which to create a table of contents. You can style the headings as a flat list, and place the list of links at the top and bottom of the section or page, to provide navigation bars similar to web navigation.

Use the Table of Content Zone macro

To add the Table of Content Zone macro:

  1. When editing, select from the toolbar

  2. Find the macro by name and select it

  3. 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 Content Zone macro:

  1. Select the macro placeholder.

  2. Select the Edit icon to open the configuration panel.

  3. Configure the parameters. Your changes are saved as you go.

  4. 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

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

location
(location

both

Specifies where in the zone the output list is displayed: top, bottom, or both, which encloses the page zone content.

Output Type
(type

list

Specifies the layout for the table of contents:

  • list – produces a vertical list, typical of a TOC.

  • flat – produces a horizontal menu-type series of links, for example: [Heading 1] [Heading 2] [Heading 3].

Display Section Numbering
(outline

false

Select to apply outline numbering to your headings, for example: 1.1, 1.2, 1.3.

List Style
(style

none

Specifies the style of bullet point for each list item.  You can use any valid CSS style.  For example:

  • none — no list style is displayed

  • circle ---  the list style is a circle

  • disc — the list style is a filled circle. This is the typical bullet list, and is the one we're using for this example list

  • square — the list style is a square

  • decimal — the list is numbered (1, 2, 3, 4, 5)

  • lower-alpha — the list is lower-case, alphabetized (a, b, c, d, e)

  • lower-roman — the list style is lower roman numerals (i, ii, iii, iv, v, vi)

  • upper-roman — the list style is upper roman numerals (I, II, III, IV, V, VI)

Heading Indent
(indent

 

Sets the indent for a list output type, according to CSS quantities. Entering "10px" will successively indent list heading levels by 10px. For example, h1 headings will be indented 10px and h2 headings will be indented an additional 10px.

Separator
(separator

brackets

Only applies to the flat output type. Specifies the display style of the links.  You can enter any of the following values:

  • brackets — Each item is enclosed by square brackets: [ ].

  • braces — Each item is enclosed by braces: { }.

  • parens — Each item is enclosed by parentheses: ( ).

  • pipe — Each item is separated by a pipe:

  • anything — Each is separated by the value you enter. You can enter any text as a separator, for example '***'. If using a custom separator, be aware that text displays exactly as entered, with no additional white space to further separate the characters.

Minimum Heading Level
(minLevel

1

Select the largest heading level to start your TOC  list.  For example, 2 will list h2, h3, and h4 headings, but will not include h1 headings.

Max Heading Level
(maxLevel

7

Select the smallest heading level to include in the TOC.  For example, 2 will list h1 and h2, but will not include h3 and below.

Include Headings
(include

 

Filter the included headings according to specific criteria. You can use wildcard characters. See Sun's Regex documentation for examples of constructing regular expression strings.

Exclude Headings
(exclude

 

Exclude headings according to specific criteria. You can use wildcard characters. See Sun's Regex documentation for examples of constructing regular expression strings.

Printable
(printable

true

By default, the TOC is set to print. If you clear this parameter, the TOC will not be visible when you print the page.

CSS Class Name
(class

 

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.

 

Examples

The examples are based on a page with the following headings:

See an example of a table of contents without filters

Filtered Table of Contents

This example will filter all headings to include those that contain "Favorite", but will exclude any heading which ends with the word "Things". The list is styled with upper-case Roman numerals.

Parameter

Value

Output Type

list

List Style

upper-roman

Include Headings

Favourite.*

Exclude Headings

.*Things

See what a shows up when you filter a table of contents

Flat List

This example will filter all headings to render a flat list of "Unknowns" enclosed in square brackets.

Parameter

Value

Output Type

flat

Separator

brackets

Max Heading Level

2

Include Headings

1 Unknown.*
See what shows up when you display a table of contents as a flat list

Wiki markup example

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-zone

Macro body: Accepts rich text.

1 2 3 4 5 6 {toc-zone:printable=false|maxLevel=2|minLevel=2|location=top|type=flat|outline=true|separator=pipe} Only headings within this block are included in the table of contents. {toc-zone}

Notes

  • Due to an outstanding issue in the Table of Content Zone 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 Content Zone macro occurs only after the page is saved.

 

Additional Help