Table of Contents
As seen at the top of this article, BasePress can automatically generate a Table of Contents (TOC) for articles in a knowledge base that have multiple headings in the content. This helps the user to see at a glance what the article contains and to jump to different parts of the content quickly. For convenience it is also possible to display a link to go back to the top of the page after each portion of the article.
The Table of Contents in your knowledge base can be displayed at the top of the article and/or on the sidebar with a dedicated widget.
To activate the Table of Contents navigate to BasePress > Settings and click on the Table of Contents tab. Select ‘Show Table of Content on articles’ to display the Table of Contents on top of the articles body. It will be displayed only on articles that have multiple headings. Nested headings are possible as well and they will be shown as child of higher headings before them. The numbering next to the titles can be switched on or off from the settings. It is also possible to disable the Table of content in each single article from the post edit screen.
To use the dedicated widget go to Appearance >Widgets and drag the ‘Knowledge Base – Table of Content’ widget to the Knowledge Base sidebar and set the title for the widget.
Read more on the BasePress Table of Contents Settings.
For very long articles it is possible to split the content in multiple pages using the standard WordPress page-link tag <!––nextpage––> where you want to add a page break.
If the article has more pages the Table of Contents will automatically redirect to the correct page where the links point to.