Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is there a way to add a Page navigation tree (based on headings in the page) to the left side bar?

Basically, I have a very large document (page) and instead of displaying its table of contents at the top of the page, I want to display a navigation tree in the left side bar based on the same criteria that generates the table of contents within the page (for example, if it finds a heading 1 then it adds to the tree).

But I want this to be in the left side panel without creating a page for each heading.

Is this possible?

2 answers

2 votes
Igor M_ Atlassian Team Sep 10, 2018

Hello,

You can add TOC macro to your sidebar same way you would to your page, but using Markdown language. 

For the example below, I went Space Tools > Look and Feel > Sidebar, header and footer and added the following markup to Sidebar section

{toc:style=none|outline=true|indent=10px|absoluteUrl=true|maxLevel=3}

It created TOC in the sidebar for the page that is currently open. From the language:

  • No bullet style was used
  • Pages were numbered by headings
  • The tree is indented by 10 pixels
  • Absolute URLs are used so that you are redirected to the page anchor, otherwise, links will not work
  • And I have chosen to show up to level 3 of pages

Any other parameters can be added by referencing Table of Contents Macro page.

So my final result was a table of contents shown in the sidebar. Every time I switch a page, TOC for that page will be displayed.

Screen Shot 2018-09-10 at 11.39.10.png

James Dellow Community Leader Sep 10, 2018

It would probably be worth creating a user macro to add some styling and javascript to make the TOC expandable

Igor,

Thank you for your suggestion. It does add the type of TOC we want to the sidebar, but whenever you click one of the links (in this TOC), it refreshes the whole page, collapses the new TOC, and the focus goes back to the document link (rather than the section where we're trying to link to.)

Any suggestions?

jychang I'm New Here Dec 13, 2021

I want to try this, but there no longer appears to be a sidebar section Confluence Cloud 1000.0.0-da503df1a09f.

I tried Space Settings > Look and feel > Page layout, but only Header and Footer sections exist under Page layout.  Then I searched in Jump to setting... and found Space Settings > Manage Space > Edit sidebar, but there are only two toggle buttons for Overview and Blog and no section to enter markup.

How do I add the TOC to the Sidebar in Confluence Cloud 1000.0.0-da503df1a09f?

Like David Austin likes this
0 votes
James Dellow Community Leader Sep 10, 2018

Another approach might be to make use of sticky table headers, by putting the TOC in the table header and the content in the table rows beneath, then use the flat list option in the TOC macro. However, this will only work in certain scenarios.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

42,037 views 29 132
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you