This site requires JavaScript to be enabled

Knowledge Base: Create a Table of Contents with Page Anchor Links

2380 views

You will learn how to create a Table of Contents with jump-to links in the article, known as page anchors.  You will learn to create IDs for jump-to locations and then creating links to those jump-to locations. ( You can also make jump-to links for any text in your article.)

This article covers:

When to use a Table of Contents

A Knowledge Base article that has two or more headings should include a Table of Contents.  This is needed with articles that are long. Using a Table of Contents will make the article easier to scan and read.  

Most articles Table of Contents can be just a simple bulleted list. (Like what is used in this article).  If an article is much longer like the "Knowledge Base: Best Practices for Knowledge Base Article" article , a bulleted list may not be sufficient. In these longer articles you will want to break down a little more with numbered sections followed by bulleted lists as needed in each of those sections.

Adding an ID to an HTML tag

  1. Open the article in Edit mode
  2. Put your cursor in the first heading you want to assign an ID.
  3. Click the Source code icon "< >"
  4. Choose an id that is concise, but descriptive.
    • The id cannot contain spaces. Hyphens and underscores can be used to split up several words.
    • The id must be unique to the page it is on.  They cannot be repeated.
  5. Add the id attribute to the inside of the heading tag before the actual heading text.
    • An id for the element goes in the opening tag, and there can only be one id per tag
    • Example: id="Write_Content">2. Write Content id HTML tag
  6. Click OK in the HTML source code window to return to the normal KB editing interface.

Linking to page content using its id

Now that you have created an id on the Heading that you would like to jump to from the Table of Contents, it is time to link to this id.  

  1. Select the text you would like to have as a link to the id you created.
  2. Click the Insert/Edit link icon Insert/Edit Link Iconon the Editing Toolbar
  3. Type the id into the URL text box.
    • Example: #Write_Content 
    • Be sure to place the hashtag in the front of the id in the URL text box to indicate that the link is an id attribute located within the page.
      •  Insert Modify link URL
  4. Click OK