SharePoint Modern Page TOC

Share on:

Create a (TOC) Table of Contents on a Modern SharePoint Online Page

Methods

There are several methods we can use to create a TOC for our page.

Tool SharePoint Standard WebPart
Power Apps ◻️
Script Editor ◻️ (Available in all SharePoint versions except SharePoint Online)
Markdown Webpart
Text Webpart

The easiest and most flexible way to create a (TOC) Table of Contents is use the Markdown Webpart.

Place your page in Edit mode, then in one of the sections click the ⊕, select the Other category then click the Markdown Webpart.

Refer to the Markdown Cheat Sheet for Markdown syntax information.

Basically we will be building a list of links but first we need the links. Every Header element we place on the page will have it's own link automatically generated by SharePoint.

For example if you add a Text Webpart to the page then add the following

Heading 1

Heading 2

Heading 3

Now publish the page. As you hover over a Heading, a link symbol will appear, right click the link symbol and click copy. Save the link to notepad or a text editor for later when we edit the Markdown Webpart.

After you have copied all the Header links click the Edit button on the page once more.

In the Markdown Editor paste the following:

- [Heading 1](REPLACE WITH HEADING LINK)

- [Heading 2](REPLACE WITH HEADING LINK)

- [Heading 3](REPLACE WITH HEADING LINK)

Rinse and repeat for all the other Headings on your page. You should now have something similar to: "SharePoint Markdown Webpart - TOC"

Or create a TOC with the Text Editor Webpart