You can link to a specific place within your page using anchors. You can also link to individual sliders or FAQs. This is useful when you have a long page and want to provide shortcuts to certain sections or when you want to direct the user to a specific piece of information within a page.
Setting Up Anchors
The first step is to create the anchor on the page in the place where you want to link to. Sliders and FAQs already have this code, so you would not need to do this step.
- Go to the code view of the CMS using the <> icon.
- Find the section where you want to link to and find the paragraph or heading tag that is around it. It should look like <p>, <h2>, <h3>, or <h4>.
- Add the ID code into that tag in the form of id=”yourid“. yourid should be short, one to two words, using only use lower case letters, numbers, and hyphens. Each ID you create on the page must be unique to the page. The code should now look like <p id=”yourid”>.
- Save and publish.
Finding the Slider or FAQ Anchor ID
Sliders and FAQs already have assigned IDs that you can link to.
- Go to the live page or in the CMS, open the Preview tab for the page.
- Right-click on the slider or FAQ title that you want to link to.
- Select “Inspect”.
- Look at the highlighted code and go up two lines.
- You should see something like id=”slider-d11e2783″ for sliders or id=”question-d11e1234″ for FAQs. The text in quotation marks is the name you need to link to.
Please note, if the title in the slider or FAQ snippet changes the ID will also change and your link would need to be updated.
Linking to an Anchor
- Select the text you want to link from.
- Click the Insert/Edit Link icon in the toolbar.
- Enter the appropriate URL.
- If the anchor is on the same page as the link you are creating, in the URL field enter #yourid (hash followed by whatever you named the anchor or the slider/FAQ ID).
- If the anchor is on a different page than the link you are creating or you are creating the link in a navigation file, first enter the URL for the page that the anchor is on by using the file picker to select the page within your site or pasting the outside URL. Then add #name (hash followed by whatever you named the anchor or the slider/FAQ ID). For an internal page your URL may look like {{f:123456}}#name.
- If the anchor is on the same page as the link you are creating, in the URL field enter #yourid (hash followed by whatever you named the anchor or the slider/FAQ ID).
- Click the Save button.
- Save the changes in the Editor.
There is no way to test anchor links within the CMS until the page with the IDs is published.