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
- 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 (or the Anchor tab if you see it on your editor version) > select the Anchor of your choice.
- Click Add 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.
21 comments
Abdul Khader Malim
Currently this way of approach not jump into respective section. Any solutions ?
2
Chris H
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
0
Rachel Gerard
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!
0
Amy Gracer
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.
0
Dawn Phelps
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.
0
Giuseppe
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:
0
Dawn Phelps
Thanks Giuseppe! For some reason I wasn't seeing that earlier, but now I do.
0
Compliance Support
Hi,
How do I link to an anchor tag in another article?
0
Jeff C
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!
0
William Grote
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?
1
Amy Gracer
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:
0
William Grote
THANK YOU! works just as I had hoped for!
0
William Grote
OK, something changed today, now when I am manually adding anchors, and then go to the links, I see a new section called Anchors?
1
William Grote
However in another article, I added an anchor tag, and the anchor appears in the Headings list and there is no Anchors section?
1
Rhonda Green
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?
0
Beto
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!
0
Mark Glinski
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?
0
Christophe A.
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.
0
Shahir ElShaieb
This does not work. I've tried linking from one article to another article using the heading id. I've created an <a name="something"></a> anchor in an article, then linked to it from another article using [article url]#something. I just get the top of the article, not the anchor, every time. I also tried adding a “name” attribute in the h tag (e.g. <h2 id="e348543573" name="useful-name"> and upon saving the article the name attribute is deleted!
It would sure be nice to link from one article to a heading in another one but I cannot do this at all.
0
Paolo
We would need to see the actual article where your anchors are added. Please reach out to our Support Team and provide as much information as possible. You may follow the guide here: Contacting Zendesk Customer Support.
Best,
Paolo | Technical Support Engineer | Zendesk
0
Dganit Rauchwerger
Hi, when clicking an anchor link in an article, it sometimes does not reach the exact location in the destination - sometimes above, sometimes below. This can sometimes be even a page above or below. Are you aware of this issue which makes using anchor tags in articles a bit problematic. Also, according to this reference, using the name attribute (as advised in your article) has been deprecated and replaced with id. Even replacing with id does not always cause the link to reach the desired destination. Would be grateful to hear what others are experiencing and possible workarounds for this issue. At this point, I am minimizing my use of anchors as much as possible. Thanks!
0