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

Create a Table of Contents in Confluence that spans child pages AND displays H2 and H3 titles

Is it possible to have a table of content (or other similar system) that displays the H1, H2, Hx titles for the root page and children pages? I would like to have something like this:


  * Introduction


    * Contact Us


    * How to Find Us

     * Requesting Support

      * Holiday Hours


      *About our Staff

           – Administration

            – IT

             – Billing and Inquiries


The CHILDREN MACRO and PAGE TREE MACRO display the pages:

  • Home Page
  • Child Page 2
  • Child Page 3

And the TOC displays the subheads of the current page:


  • Introduction
  • FAQ
  • Contact Us

But I don't see anything that combines the ability to drill down to the subheads as the TOC can on the children pages.


Any suggestions? I am not looking for a complex, custom macro (out of my skillset) but was wondering if there were a solution I had overlooked.





11 answers

I developed this solution:

1. Create a blank page entitled: TABLE OF CONTENTS.

2. Space Settings > Reorder pages: Make all of your parent pages child pages of TABLE OF CONTENTS.

3. I have sections: In each section page (and otherwise these are blank), I inserted the Children Display Macro. Show Descendants: Click. Heading Style: H2/3--see example below. (I made no other changes.)

4. TABLE OF CONTENTS page: I inserted the Children Display Macro. Show Descendants: Click. Heading Style: H1. (I made no other changes.)

What appears on my TABLE OF CONTENTS page: 



    SUBSECTION a: Used H3

        Page 1

        Page 2

    SUBSECTION b: Used H3

        Page 1


and so on.

Hint: You can copy and paste these macros.

IMHO: Why isn't there a Space ToC macro? This is a rudimentary req for all Documentation??

Note: I just ran this op on another space and did not use the Children Display macro and I still see what I see above. 

Best Practice Hint: Go the extra step and copy-paste your h2/h3 children macros into your subsections and their child subsections. Your users with thank you!

Like Daniel Lowe likes this

Great idea Don. Very similar requirement here which also would be solved by a solution to your issue. In our index page we can use a child-pages macro but it'll only list child pages. If headings on any of them are of interest to people consulting the index -- which high-level headings invariably are -- then they're invisible because the child-pages macro doesn't display them. A composite which could list child pages and their headings down to a selected level would be very useful.

Hi Bill,

You mean why do I want to do this? Fair enough inquiry and I admit this may not be a common situation.

My company wants to organize the content of various team within a common Confluence look and feel, if you will. Each team uses Confluence but in its own way, but generally populating Confluence with the same type of information.

The idea I am playing with is to have "one page to rule them all and in the darkness bind them" meaning I would like to have one page that is essentially an index page to all the subordinate content.

So you may have one doc that has a team calendar, another with Retrospective or meeting notes, and so forth.

For example then, I would have a page "Staff". On the page "Staff" I would have an H2 (or whatever) for "Director" and below that the director contact info. Another would be "Technical Support" and below that the tech support contact person. A third might be "Writer" and below that would be the contact info for the team writer.

Or if there is a longer, say requirements doc, then I would have a "Requirements" page that would contain headings for say, "Summary", "Business Impact", "Budget Analysis", "Time and Manpower Estimates" and so forth.


Now, back to the "one page to rule them all..."


The index or TOC or Child Pages list or whatever would now display in one place all the team's content:



        * Februrary

         * March.....



            * Starfish

Meeting notes (stand-alone series of pages)


.      * Director

        * Technical Support

         * Writer



           * Business Impact

            * Budget Analysis

             * Time and Manpower Estimates

NOW, some of this can be accomplished by just having a TOC that reports out child page names. And this approach is not totally fleshed out yet.

BUT, since there is a macro for child pages, and a macro for a heading-based TOC, it seems to me (with no knowledge whatsoever) that one could have the two outputs combined to have a TOC reporting child pages that have a sub-entries, the heading level content.


The advantage for ME (since it is all about ME) is that content won't get lost. The "index" page will now dynamically update as new content is added, and there  will be a fair degree of discrimination with what that content on the page actually is, since the H2, H3 or whatever topic heads are selected, also are reported back and displayed. If people want to find something, they can hit the "index" page, scan a rather comprehensive TOC-style list, then click directly to the desired content.




Don Wallbaum


Here's the simplest 2-step way to add a table of contents that includes both children pages and relevant headings inside those pages. So, for example, if you have your space in the following format:

Main Page

  • Subpage 1
  • Subpage 2

And each of the subpages has sections - a structure of headings that you want to show:

  • Subpage 1
    • Section 1
      • Subsection 1
      • Subsection 2
    • Section 2
    • Section 3
  • Subpage 2
    • Section 1
    • Section 2

Here's how you do it:

  1. Add a Children Display macro to the parent page (Main Page in the above example) with an Excerpt Display setting set to "rich text". It's a setting inside Chidren Display macro that shows "none" by default. Change it to "rich text".
  2. Then add Excerpt macro to each of the children pages (Subpages in the above example), and put Table of Contents macro (TOC) inside. That's it.

Adding a macro is as easy as typing “/” followed by keywords, like “children” or “table”.

After adding TOC inside the Excerpt, you can also add a paragraph (just hit “Enter” key right after you’ve added TOC). That way your Children Display on the parent page will look a bit neater.


You can configure the max/min heading level you want to display in TOC. So, like, if you don't want to show any headings for a particular subpage, no problemo, just configure the TOC to what you need to have displayed. Also, you can add "Table of Contents:" before the Excerpt macro to have a neater visual look of each subpage, if you want.

And if you’d rather not have TOC on the children pages, just configure Excerpt macro to “Hide Excerpted Content”. Then your subpages will be clean from TOC, but the Main Page will still show it.

Anyways, two easy steps above will get you a good table of content in the parent page that stretches across all children pages and headings inside those pages.


Yet another Confluence user in search of this kind of solution.

Sometimes, a flat list of pages is not enough.  We would very much like to be able to also show the main headings in each child page.

The workaround is far from elegant --

  • Do major surgery on each child page with headings, to cut-and-paste each heading section into sub-pages.  → This is enormously tedious and a pain for future content maintenance.

For large spaces with legacy content, this workaround is untenable.  For new content, this workaround is also usually untenable, due to the high maintenance overhead.

I am also looking for a solution to this - exactly as the OP suggests: I want to see the child pages listed in a TOC with all headings listed underneath them. This would produce a complete TOC for an entire section of documentation.

Did anyone find a solution to this problem?

I have the same requirement as I am generating the PDF document, It's needed to display the contents of H1, H1, H3 styles in the TOC as subsections.

0 votes
Bill Bailey Community Leader Oct 22, 2016

My instinct is to just assign each team a space, then set the left-hand navigation to Page tree display. Lastly, on the space home page, insert a search box macro, restricted to that space.

You wont have a display showing headings on the page, but you will have a restricted page tree and search box. With search, nothing will get lost.

Bill, I ended up replying to my original post - error on my part. Please scroll up to see my response to your question.





0 votes
Bill Bailey Community Leader Oct 20, 2016

I am curious about the use model.

Suggest an answer

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

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,499 views 7 29
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