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

Nesting headers within expandable sections.


Since my instance of Confluence contains pages with a vast amount of content, I've resorted to using the Expand macro to wrap content within expandable text boxes. As one would imagine, this significantly reduces the size of pages.

However often times, I have to include content under Header 3s within expandable sections along with the headers themselves.

Since the TOC on most pages index headers up to level 3, these naturally list all Header 3s of a page even if they might be hidden in an expandable section. 

On clicking the listings of these Headers from the TOC however nothing happens, simply because they're hidden behind expandable sections. 

Is there a way to overcome this issue? It would be helpful if clicking on a Header hidden behind an expandable section within the TOC would atleast take users to the respective expandable section.


1 answer

Hi Sean,

I've had this same issue with Confluence.  Table of Contents navigation doesn't work with headings when they're collapsed in Expand macros.  You can't even use Ctrl+F to find collapsed content - the macro must be expanded.  I settled on other methods of displaying my content.

  • Content Slider macro (in the paid Image Slider for Confluence plugin): Headings embedded in Content Slider Entry macros will still show up in the Table of Contents and can be clicked to navigate, and embedded content can be found with Ctrl+F.  This is still true if the heading/content is not on the active slide, but users may not find it intuitive to scroll through the slider to find their content.
  • Tabs Container macro (in the paid Content Formatting for Confluence plugin): Also a good way to separate content while keeping it on the same main page, but you'll want to use the Table of Content Zone macro if you want each Tabs page entry to have its own Table of Contents without pulling headings from the others.

You could experiment with hiding headings in white text just above the corresponding expand macros, but then both headings would appear in the Table of Contents.  It might just be easier to change the maximum heading level in the Table of Contents to 2 so those in Heading 3 aren't displayed, and then break your content up into more Heading 2 sections.

Good luck!

Thanks for the help, Jared. 

Seems like there's no direct fix indeed, but I appreciate the alternatives you've pointed me towards. 

Especially the Content Formatting plugin's Tab Container; doesn't directly solve the problem, but it definitely makes the reading experience better as opposed to expandable sections. 


Glad I could help!  Let the rest of us know if you find a solution to the Expand headings.

Hey Sean,


This is a bit of a hack around but I found it works for small numbers of expandable areas.

I put the table of contents within the expandable areas and set them to only do one heading type: this means that it creates links to the data in the expandable areas but they are only visible once the area is expanded.

For example:

-expandable area 1:

  toc1 : applies only to header 3 (note all sections in this expandable area are header 3)

-expandable area 2:

  toc2 : applies only to header 4 (note all sections in this expandable area are header 4)



Like I said bit of a hack around but I found it worked alright. Just doesn't look great if you have too many expandable section because the more you have the smaller your headings start to become.



Suggest an answer

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

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

8,368 views 6 6
Join discussion

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