ServiceNow Knowledge: Create a Table of Contents or Other Jump-to Links
Lengthy articles that contain a table of contents (TOC) with links are easier to scan and easier to navigate using adaptive technology. You can make a table of contents by creating 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.)
Note: Before you create the IDs for the jump-to locations, Remove Extra HTML Formatting from the Article. Otherwise, you will have to recreate the IDs when you enter the cleaned HTML into ServiceNow.
Unless the article is short, if it has two or more headings, include a TOC in the form of a bulleted list. For example:
This article covers:
Adding an ID to an HTML tag
- Open the article in Edit mode.
- Put your cursor in the first heading that you want to assign an ID.
- Click the Source code icon on the Editing Toolbar. The heading tag will be highlighted.
- Choose an id that is concise, but descriptive.
- The id cannot contain spaces. Hyphens and underscores can be useful to split up several words.
- The id must be unique to the page it is on. They cannot be repeated.
- 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
id="using_global_search">Using Global Text Search (upper right corner).
- Click OK in the HTML source code window to return to the normal KB editing interface.
- Continue adding other IDs as necessary.
- You can stay in the Source Code window and use the Find feature to look for heading tags.
Linking to page content using its ID
At the appropriate location in the article, usually below the article context:
- Create a bulleted list using the heading names for the jump-to links.
- For each line of text:
- Select the text.
- Click the Insert/Edit link icon on the Editing Toolbar.
- Type the id into the URL text box.
- Example: #using_global_search
- Be sure to place the hashtag in front of the id in the URL text box to indicate that the link is an id attribute located within the page.
- Click OK.
- Repeat as necessary.