TOC on every page by default

Ryan Goodwin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2012

Wanted to add this capability for those out there looking to unify page layouts within a space:

Goal here was to have a table of contents on every page in a given space, but this could be used to render any macro on pages in a given space.

* Navigate to a space, Browse > Space Admin

* In the Look & Feel Section > Layouts

* Page Layouts > Create custom

In velocity templates, you can call a Confluence macro using notation like this:

$helper.renderConfluenceMacro("{toc}")

Depending on where you want this to render determines where you place it. In my case, I wanted the toc to render above the main content section, so I put this after the metadata section but above the main-content section.

Hope this helps!

3 answers

1 accepted

1 vote
Answer accepted
Ryan Goodwin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2013

answered to close this out.

0 votes
Sorin Sbarnea (Citrix)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2012

But it doesn't work if you try to add it to all pages, see bug https://jira.atlassian.com/browse/CONF-14004

0 votes
SimonS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2012

This might be a good "how to" article in the Confluence Knowledge Base space too.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events