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 appear 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
Option 2
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 you want to make into a link. Then, 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:
2. 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 interfere. If that is the case, minimize 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.
18 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?
We are finding that the when anchor link is clicked, it dropped well below the heading. I have noticed this in every article that we have tried to anchor. Is this a known issue?
Hello Rhonda, thank you for your question!
I can confirm that this is the expected behaviour. When you create an anchor on a heading, once clicked, the "link" will send the user to right below said heading. The idea here is that the user reads the link/phrase that has the hyperlink/anchor, so there would be no need for them to read it again, once they are directed to the paragraphed that is referenced.
You can see an example of this following this link. This is a hyperlink to an anchor section of the article. Specifically to the section called "Adding articles to the knowledge base" but the link takes you to just below the heading, since you would have already read it if you had seen the article.
You could theoretically create the anchor on a phrase that is right above the heading, so that when you are redirected, you could see the heading instead. But this would mean that you would need to create a different heading for this.
I hope this was helpful!
I find that I cannot link to anchors within articles from outside Zendesk. For example, we want to link into a section of an article from our UI, so we create an anchor for that section that works fine within Zendesk. But the link from the UI just goes to the top of the article.
Zendesk, is there a fix or workaround for this?
Anchor links are not specific to Zendesk. This is a HTML element and it should work even if the link is outside Zendesk.
Maybe try with a different web browser. This may be due to the configuration of your browser.
Please sign in to leave a comment.