1800 677 656

How Do I Create an Anchor Link in Drupal?

Anchor Link

An anchor link allows you to jump from one section of text to another on the same web page. You would use anchor links when you wanted to list topics at the top of the page and then have the ability for a customer to click that topic and be taken straight to it without having to read or scroll through the balance of the text.

This is a two-step process. First, you must create an Anchor on the destination before you link your text to it.

1. Creating an Anchor

  1. Ensure that you are logged in and go to the page where you want to add anchors.
  2. Be in edit mode.
  3. Scroll down the page to where you want to add your first destination anchor.
  4. Place your cursor where you want the customer to land, (no need to highlight text as Anchors are applied to a line, not a word).
  5. Click the "insert/edit anchor" button
  6. Give your anchor a name that will make sense when you want to link to it. (Ensure your anchor has no spaces and you separate words by using - or _).
  7. Click ok.
  8. Create all your anchors for your page first.

2. Creating a Link to the Anchor

  1. Scroll back up to the top of your page and highlight the text where you want your first anchor.
  2. Click the "insert/edit link" button 
  3. Click the "link type" down arrow and select "link to anchor in the text"
  4. Select the anchor you wish to link your text to
  5. Click ok
  6. Once you have linked the text you will see that it is a different colour.
  7. Click "Save" at bottom of the page.

Please note: It is also good practice to put an anchor at the top of your page called home, you can then add a link at the bottom of your content on text that says "return to the top of page".