Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I include headings from an Included Page in a TOC?

Deleted user December 17, 2024

I would like to surface headings from content in an "included page" into a table of contents. I tried "copy link to this heading" and then pasting the link onto text, but this did not create the result I wanted. (Ability to click on heading in the TOC to jump down to the section on the page).

AFAICT you can't add anchors into an included page. LMK if I can, or there's any other work-around.

Thank you!

1 answer

0 votes
Kristian Klima
Community Champion
December 17, 2024

Hi @[deleted] 

You can simply put a heading in front of the include page macro to create a TOC entry for the included page.

Here be dragons

/here be page include macro

(I admit, not the ideal solution as it effectively duplicates the title....)

HOWEVER :) A solution would be to use a TOC ZONE macro.

Deploy the TOC Zone macro and then put the page include macro inside.

(I admit, again, it's not ideal but it does offer 'shortcuts' to jump to the desired content). I'd experiment with the macro and page structure to get the desired layout.

For example... placing the ENTIRE content of the page within the TOC Zone macro...

2024-12-17_17-18-41.png

 

What's interesting is that headings included in macros are normally displayed in the TOC but are not clickable. With page include, I can confirm that headings from the included page do not appear in the TOC.

 

We use Scroll Viewport to create our doc site and, as it doesn't rely on the Confluence  TOC macro, it creates a TOC with fully clickable elements even if the original heading is within a macro.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events