Date: Fri, 29 Mar 2024 12:30:28 +0000 (UTC) Message-ID: <1093352287.696.1711715428547@[13.43.82.202]> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_695_1245092261.1711715428538" ------=_Part_695_1245092261.1711715428538 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This tutorial describes how to add a table of contents t= o the menu bar...
We will initially assume that you want to add the Table of Contents at t= heme level in order to show the contents throughout the Space...
To do this, open the Edit menu and choose "Admi= nistration" then "Configure Theme":
The menu is usually located in the Menu Bar so from the Edit menu, choose Menu Bar and then scroll down to view the wiki = notation used for the menu.
The toc macro generates a table o= f contents based on the headings in a wiki page (or blog post):
{toc}
For this page, that results in:
To add the table of contents to the menu bar, you need to wrap the {toc}= macro in the wikimenu macro like this:
{menubar} {wikimenu}{toc}{wikimenu} {menubar}
This embeds the table of contents inside your menu bar.
Obviously, if you have loads of headings on your page the menu bar will = become very cluttered so it's advisible to put the contents in to their own= pop-up menu:
{menubar} {menu}Contents {wikimenu}{toc}{wikimenu} {menu} {menubar}
That's it - simple, eh? Now save the theme configuration.
Go to a normal page that has headings in and open the "Contents" menu:= p>
As you can see, the menu is automatically generated from the text Headings on the page.
Now that we've added a basic table of contents to a menu, let's take a l= ook at some alternatives...
While having the table of contents shown as hierarchical menu items is p= retty neat, there are times when you want to see the full table of contents= and this can be achieved as follows:
{menubar} {menu}Contents {menuitem}{toc}{menuitem} {menu} {menubar}Cool, eh?
If you're adding the table of contents to a sidebar, you should use vert= ical menus like this:
{menubar:verti= cal=3Dtrue} {wikimenu}{toc}{wikimenu} {menubar}The addition of "vertical=3Dtrue" makes the top-level menu appear vertic= ally rather than horizontally.
If your pages are quite long and require scrolling, the menu will often = not appear on the screen making access to the table of contents somewhat di= fficult. So, to provide instant access, you can create a context menu:
{menubar:conte= xt=3Dtrue} {menu:class=3Dcontext-for-document} {wikimenu}{toc}{wikimenu} {menu} {menubar}And the result? Well, try right-clicking this page!
Because the table of contents is only shown on pages or blogposts, you c= an use the builder-show mac= ro to prevent it appearing in other locations (such as search results o= r dashboard):
{menubar} {builder-show:context=3Dpage,blogpost|mode=3Dview}{menu}Contents {wikimenu}{toc}{wikimenu} {menu}{builder-show} {menubar}
If you have plenty of RAM available, you can cache the table of contents= with the cache macro like this:
{menubar} {builder-show:context=3Dpage,blogpost|mode=3Dview}{cache}{menu}Contents {wikimenu}{toc}{wikimenu} {menu}{cache}{builder-show} {menubar}
The cache will automatically be cleared whenever the page or blogpost is= edited so it's a really nice way to improve performance.