KB User's Guide - Documents Tab - How to Create Anchor Tags and Links

This document is specific to the Classic Editor, which is being retired. We recommend trying these steps in the TinyMCE if possible. Please browse our documentation on TinyMCE for help.

If you need to link to a specific section within a document, you can do so by using an anchor and a link that points to that anchor. This document contains step-by-step instructions on how to add anchor tags and links to your documents using the WYSIWYG editor.

Note: These instructions may vary slightly by browser.

Start by going into KB Admin Tools and opening the Documents tab. Either create a new document or edit an existing document. Be sure the editor is in WYSIWYG (Design) mode.

Perform the following steps in the Body field of the document editor:

Create the anchor for the section to which you want to link

  1. Enter the text that will serve as the anchor and select it. Usually this is the heading for your section. Click the Anchor button as shown below in the WYSIWYG Editor. If you are in the HTML Editor, look for the  anchor tag button in the html editor  button.

    Classic editor showing highlighted text and a selected anchor button

  2. Enter an anchor name. This should be one word with no spaces.We do not recommend using underscores to separate words because and underscore would be difficult to identify when linked. You could capitalize the second word, for example, "UsefulTips" would work well. Please remember what you entered here, as it will be used when you create your link to this anchor. Click OK.

    popup message asking for an anchor name

  3. Give your anchor a title. This should roughly match the heading of the section or otherwise describe the content near the anchor. Click OK.

    popup message asking for an anchor title

  4. The text you selected in step 1 should now be preceded by an anchor icon and subtly underlined. This means your anchor has been successfully inserted.

    document editor showing an anchor icon next to some text

Create a link that points to that anchor in the same KB document.

**to create a link that points to a completely different KB document, click here.

  1. Type the text that will serve as the link. For example:

    document editor with a line of text

  2. Highlight that text and click the Link button as seen below in the WYSYWIG Editor. If you are using the HTML Editor, click on the link button icon in the html editor button.

    document editor with highlighted text and a icon of a chain being selected

  3. Enter the target URL of the link. This should be the name of the anchor you entered previously prefaced with a # character. Click OK.

    popup message asking for the target url of the anchor link

  4. Enter the title for your link. This text should roughly match the text you entered in step 1. Click OK.

    popup message asking for the title of the link

  5. You will be asked if the link you just entered should open in a new window. Consider your answer and then either click the OK button for yes or click the Cancel button for no. We generally recommend that you use the existing window.

    popup window asking if link should open in a new window

Create a link that points to that anchor on another KB document

To point to an anchor on a different KB document, you need to add a little more text in the target URL of the link field, so the browser knows that some of the current URL will also change.

The full URL of a KB document looks like this: https://kb.wisc.edu/YourKBSiteNameHere/page.php?id=12345 or https://kb.wisc.edu/YourKBSiteNameHere/internal/page.php?id=12345.

    1. Enter the last part of the URL (for example: page.php?id=12345#anchor_name)in the Enter the target URL of the link: field.

      Everything before that part of the URL will remain the same (so you would be loading the page in the same KB space), but the browser will now load the correct document before checking for the presence of the anchor name.

popup window prompting for the target url

    1. Enter the title for your link.

popup window prompting for a link title

    1. You will be asked if the link you just entered should open in a new window. Consider your answer and then either click the OK button for yes or click the Cancel button for no. We generally recommend that you use the existing window.

popup window asking if the link should open in a new window




Keywords:add anchors tag link to section link within a page link points to anchor a href tag point hashtag syntax automatic anchors   Doc ID:18575
Owner:Leah S.Group:KB User's Guide
Created:2011-05-16 19:00 CDTUpdated:2022-06-16 12:17 CDT
Sites:KB Demo, KB Demo - Child Demo KB, KB User's Guide
Feedback:  0   0