Question
How do I manually create anchor links in articles in Zendesk Guide?
Answer
With Guide, you can use the Insert/edit link on the editor's toolbar to add anchors in your articles as described in the article: Inserting and editing links in articles.
When you use this feature, the heading doesn't show up when the customer selects the anchor link. As a workaround, create the anchor link through the Source code of your article.
To manually create an anchor link:
- With the article editor opened, select the Source code </> icon.
- Navigate to the text that you want to target with a link. Insert the code snippet below before the text, this is typically on the same line:
<a name=your_anchor_name></a>
- Enter the desired anchor link name. Here's an example containing an
<a name="section1">
anchor: - Link to the anchor by following one of these two options for this.
Option 1
- Select the text you want to use as the link, then, click the Insert/edit link icon.
- Select the Heading tab and find the anchor name you added.
- Select Link.
Option 2
- In the Source code editor, find the text that you want to make into a link. Enclose the text in the tag below:
<a href="#your_anchor_name">Link text</a>
In this article's example, we want to make Section I into a link. We changed the code from:
<li>Section I</li>
To:
<li><a href="#section1">Section I</a></li>
Wrap the link text in opening and closing <a> tags or there won't be anything for the user to select.
The example below shows how the link looks behind the editor before the article is saved:
4. Click Ok to save your changes.
If the anchor appears to jump a few lines below the expected location, the toolbar at the top of your screen may be interfering with it. If that is the case, try minimizing the toolbar and test the anchor link again.
You can also link to an anchor link on another page using the full URL plus the hashtag. For example:
<a href="https://support.zendesk.com/entries/98542436#some_anchor_name"></a>
Using a hashtag without a URL works only if the anchor is on the same page.
If you want the anchor link to go to your header, rather than a few lines down, include a few page breaks between the header and the text body.
For more information, see the article: Inserting and editing links in articles.
14 Comments
Currently this way of approach not jump into respective section. Any solutions ?
Hello Abdul,
Does the link not appear when you create it this way? Do you have an example of the line of code you are using for this link that we can review?
I look forward to assisting on this!
Best,
Chris H
Technical Support Architect
Zendesk offers free, on-demand training for all of our products. Set up your account and start learning today at training.zendesk.com
Hi there,
Is it possible to create an anchor tag on the Help Center homepage? For example, if they click a link at the top of the Help Center, it brings them all the way down to where our Knowledge Base is?
Thanks!
Yes, if I understand what you are looking to do.
Here is a snippet from my test homepage. The bold "Link" href jumps to the named H1.
Is it possible to anchor link to a heading that isn't H1? For our Style Guide, we prefer headings to be H3 and would find great value in anchor linking - but right now the only way I can get anchor linking to work is if I use H1 for my headers.
Hi Dawn,
By clicking the Anchor button and choosing Heading, you should be able to choose from the headings in your article, regardless if they're H1 or not:
Thanks Giuseppe! For some reason I wasn't seeing that earlier, but now I do.
Hi,
How do I link to an anchor tag in another article?
Hi there,
At the bottom of this article, you'll see a way to do this by doing the following -
You can also link to an anchor link on another page using the full URL plus the hashtag. For example:
Using a hashtag without a URL works only if the anchor is on the same page.
Let me know if that isnt want you are looking for!
Is there a way to add anchors to longer articles so that a user can jump to that part of the article without making it a clickable link? We are adding in context help tips to our UI and want to allow users to click on a link in out UI and be brought to the right section of an article, but don't necessarily need to have actual links in the articles themselves?
William Grote
You can add anchors using the <a name = "anchor">
Then when you want to link to it, link to the full URL followed by #anchor.
Jeff's example above should work:
THANK YOU! works just as I had hoped for!
OK, something changed today, now when I am manually adding anchors, and then go to the links, I see a new section called Anchors?
However in another article, I added an anchor tag, and the anchor appears in the Headings list and there is no Anchors section?
Please sign in to leave a comment.