Anchor links allow you to create a link that points to a different location on the current page. Anchor links work especially well in long documents with a Table of Contents; site users can click a link in the table to jump directly to that part of the document.
Creating anchor links is a two-step process:
- Create a 'target' location, called an "anchor," on the location in the page where the user will end up.
- Create a link which points to that anchor.
Here's an example of an anchor link: you can jump directly to the "Troubleshooting Anchor Links" section of this article.
Creating an Anchor
The target location on the landing page is really just a spot on the page that's been given a specific name. This is done in the text editor inside a Content element.
Open the text element, find the location where you want users to end up, and click the 'Link' button. (Note that you don't have to highlight any words, just place the cursor at the right spot in the content area.)
Select "Add/Edit Anchor" from the Link button menu.
You'll be prompted to give your anchor a name.
Creating a Link to Your Target
Now that you've established an anchor, you can create a link to it from somewhere else on the page.
Highlight the text, image or other resource that will link to the anchor, and click the "Link" button again.
This time, select "Insert/Edit Link."
In the Link Settings window that pops up, select the "Anchor" link type, then use the "Anchor" dropdown menu to choose the target for this link. Any anchors that you've created on the page will appear in this dropdown.
Click the blue Save button, and you're done. The text you highlighted will now become a link that takes users to the anchor that you created.
Troubleshooting Anchor Links
The most common problem with anchors results from putting spaces or symbols in the anchor names. Do not put spaces or symbols in anchor names, though underscores may be safely used to separate words if desired.
Acceptable anchor name formats:
Unacceptable anchor name formats:
to the top
#top (you do not need to enter the # symbol for an anchor, the web editor will do it for you!)
If you have created your anchor names with spaces, you will need to delete them, create them again, and re-create the anchor links by picking the newly corrected labels from the Create Link window.
Another issue that may cause your anchors to mysteriously turn into links to the home page is if you create the anchor link while working in https mode. Make sure the URL showing in your browser while working in the Unpublished tab is http://www.mywebsite.com/admin.... and not https://www.mywebsite.com/admin....
You can change from https to http mode simply by deleting the "s" in the URL in the browser and pressing Enter.