Table of Contents in articles allows your users to navigate contents quickly. MinervaKB provides two modes of ToC:
- inside article body
- in sidebar, as a widget
These two modes cannot be combined, you need to setup one or another (the default is inside the article body).
ToC in Article body
To enable Table of contents in article body, go to MinervaKB – Settings – Table of contents and enable the following switch:
After saving the Settings the system will start searching the articles for headings and will build the ToC dynamically. All you need to do is add some headings to your articles:
The table of contents is displayed at the top of the content and looks like this:
ToC as a Widget
To use table of contents as a widget, you need first to make sure your article has sidebar. Go to MinervaKB – Settings – Article and select Left or Right sidebar (you’ll probably want to make it sticky as well).
Next, scroll down to ToC widget settings block and enable the following switches:
ScrollSpy allows the current ToC item to be highlighted as user scrolls the page (it is optional).
Finally, after saving the settings, you need to go to Appearance – Widgets and add KB Table of contents widget to KB Article Sidebar:
That’s it, you should now be able to see ToC widget in your article sidebar (make sure it has headings).
There are many options available in MinervaKB – Settings – Table of contents, you can use them to better customize ToC for your site.