Nesting headers within expandable sections.
Asked by SB:

Hello.

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.

Thanks.


Answers:
author: Jared Brenner
body: 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](https://mohamicorp.atlassian.net/wiki/spaces/DOC/pages/816775169/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](https://www.adaptavist.com/doco/display/CFP/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!

comments: author: SB
body: 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.

Cheers!


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


author: Bradley Parsons
body: 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)

etc.

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.

Cheers,

Bradley


Tags: confluence-server

expand

macro

server

table-of-contents