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.





8 answers

0 votes
Bill Bailey Community Champion Oct 20, 2016

I am curious about the use model.

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


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

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.

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.

Did anyone find a solution to this problem?

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!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,633 views 4 13
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you