Floating Table of Contents for Confluence Documentation
Adding to a Page
On a page where you want to have a Floating Table of Conents, start typing a “/” followed by the beginning of the word “floating”. You can add the Floating Table of Contents macro anywhere on a page.
Click on the Floating Table of Contents box
You will see the Floating Table of Contents Edit box appear
(Optional) To configure the Floating Table of Contents macro see the Configuring the Floating Table of Contents section.
Publish the page by pressing the Publish button in the top right of the page.
You will then be able to see a Floating Table of Contents on the right of your page content which will stay visible wherever you scroll on the page.
Caching
Due to Confluence caching, after making a change to the headings or width of a page, you may need to refresh the page after publishing a change before the Floating Table of Contents will display correctly and fully up to date.
Similarly, due to Confluence caching, If you make a change to the Floating Table of Contents Minimum Heading Level or Maximum Heading Level parameters, you may need to Publish the page, then edit it and Publish it again for the changes to the parameters to take effect.
Configuring the Floating Table of Contents
Include headers from Include and Excerpts
Unlike the built in Table of Contents Macro, the Floating Table of Contents macro allows you to include headers from pages that are visible on the page because they are included via the “Include Page” or “Excerpts” macro as if they were directly written onto the page. All you need to do to enable this behaviour is to tick the “Include headers from Include and Excerpts” box.
Display Section Numbering
Tick the Display Section Numbering box to have section numbers displayed next to the headings.
Here is an example with the box ticked and Display Section Numbering enabled:
And here is an example with the box not ticked and Display Section Numbering disabled:
Minimum and Maximum Heading Levels
You can configure the Minimum and Maximum Heading Level as you would with the built in Table of Contents macro. If you leave these values at their defaults then all Headings on the page will be displayed in the Floating Table of Contents.
The Minimum Heading Level setting is minimum heading level to display in the Floating Table of Contents. For example, '3' will list headings from 'h3.' (Heading 3) onwards, but not 'h1.' (Heading 1) or 'h2.' (Heading 2).
The Maximum Heading Level setting is maximum heading level to display in the Floating Table of Contents. For example, '4' will list headings up to 'h4.' (Heading 4), but not from 'h5.' (Heading 5) onwards.
Non-floating (static) mode
If you want the Table of Contents to just appear in the normal flow of the page like the standard Table of Contents macro, then you can tick the “Appear not floating on the side” option.
An example of this is the Table of Contents at the top of the page.
Show Contents of direct Child pages
For some use cases you may want to have a Floating Table of Contents on a Parent Page that displays a Table of Contents for all of its direct Child pages. This will not include any headings from the Parent Page itself. If you want the Table of Contents to behave like this then tick the “Only include contents of direct Child pages of this page in the Table of Contents” option when configuring the macro.
Clicking any of the headings in this Table of Contents will take you to the appropriate page.
You may want to use this in combination with the Show contents of direct sibling pages option so that the Parent and Child pages share the same Table of Contents.
The pages will be sorted in the order they appear in the left hand menu.
This option will add additional Heading 1 headings to the Table of Contents with the Title of each Page.
Show contents of direct sibling pages
In the above Parent and Child use case for Show Contents of direct Child pages you may also want the Child pages to have a Table of Contents that is the same as the parent page. If you want the Table of Contents to behave like this then tick the “Only include contents of pages which share the same parent in the Table of Contents” option when configuring the macro.
Page Width
The Floating Table of Contents will only display when there is enough room to display the table of contents alongside the page content without obscuring it. When viewing a Confluence page with the content set to fill the full page width, then you may need a very wide browser window to see the Floating Table of Contents
Hiding
If you do not want to see the Floating Table of Contents when browsing a page, for example if you are browsing on a device with a very thin width, then you can press the X button to hide the Floating Table of Contents.
Expired License
If your license for the Floating Table of Contents macro expires or is cancelled you will see the following instead of the Floating Table of Contents.