ServiceNow Knowledge: Create Internal Links in an Article
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 internal links to those locations.
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. For example:
This article covers:
Adding an ID to an HTML tag
- Open the article in Edit mode.
- Click the Source code icon on the Editing Toolbar.
- Find the heading that needs an id placed inside of it.
- 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.
Linking to page content using its ID
At the appropriate location in the article, usually below the article context:
- Create a bulleted list consisting of the headings for people to be able to jump to.
- 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.