Recent searches


No recent searches

Inserting and editing links in articles



image avatar

Jennifer Rowe

Zendesk Documentation Team

Edited Jun 21, 2024


4

67

67 comments

image avatar

Ryan McGrew

Zendesk Product Manager

Hey All,

I've escalated this to a ticket for the team to investigate as this appears like a bug. 

Thanks!

0


Kristina Tibbitts
In our case, it is up and running again. (Maybe give it a new try :-) ) 

0


We are also experiencing this, and we must have TOCs in the top of our articles. (VERY frustrating that we cannot use a proxy TOC, but that's another story for another day.)

Can someone from ZD please respond with an update as to when we can expect a fix for this issue?

0


We are able to see the contents in the heading, However, when we try to link with in the article, It jumps to other section of the article. 

Zendesk team, can someone help me on this. 

1


0


Hey Y'all - Looks like the bug is fixed. Was able to create and link to headings on a fresh article this morning.

0


Hey everyone, this was working for me for a few days and today again, no luck - I don't see my headings again...

Very frustrating. Are others experiencing the same?

0


image avatar

Giuseppe

Zendesk Customer Care

Hi Dganit,

I understand this can be frustrating. I've tested this on multiple accounts but I'm not able to replicate the issue. Adding a link to heading seems to be working properly:

 

 

Since this has worked before, and only stopped working recently, we may want to ensure that this is not a browser-caused issue by following the steps in this article - Options to clear cache and cookies.

0


Hi @..., things seem to be fine now. Thanks for your assistance.

0


I'd like "Open in a new tab" to be defaulted On. Is there any way to do that?

2


image avatar

Jupete Manitas

Zendesk Customer Care

Hi Janine, thanks for writing in! I see that you would like that "Open in a new tab" to be defaulted On. Unfortunately, this is something created natively and we don't have the settings in our admin to make it default as selected. However, you can post a product feedback in our Guide about this. Here is our link for Guide - Product feedback. Thank you!

0


Hello, I was wondering, if I update the title of an article, do I have to manually update all the links to that article elsewhere in the knowledge base? In this instance, the links are in a "See also" Section at the bottom of articles, and the "Text on Link" is the title of the article.


Thank you for your time.

0


image avatar

Brett Bowser

Zendesk Community Manager

Hey Tommy, 
 
If you update the article title then they should also be updated when viewing all articles within a section as well. That being said, if you referenced an article by title in another article then those would need to be updated manually. 
 
Let me know if I'm misunderstanding your question!
 
 

0


Hello, do you have any best practices for adding links to articles and then managing translations?

We have translated more than 100 articles and had to spend a lot of time checking article by article and manually changing the links to the correct language.

Any input is appreciated, thanks!

 

0


image avatar

Anne Ronalter

Zendesk Customer Care

Hi Rebeca,

Thank you for your Feedback on that.

Natively this is unfortunately not possible, but as a workaround, you can use Google Analytics for finding broken links to deleted pages:
https://support.zendesk.com/hc/en-us/articles/4408883297690#topic_ys2_rr3_gn

0


image avatar

Jennifer Rowe

Zendesk Documentation Team

Hi Rebeca

I know you might not have dev resources to help with this, but just thought I'd mention that we run a script to update links in all our translations when we publish them. That's how we manage it for the documentation here at Zendesk.

Unfortunately there's not a a native solution, as Anne mentioned.  

1


Thanks for the answer Anne Ronalter.

Jennifer Rowe where can I find more information about this script? we work with some developers, and I could bring this up with them.

Thanks in advance!

1


image avatar

Jennifer Rowe

Zendesk Documentation Team

Hi Rebecca,
We haven't published anything about the script we use and I don't know anything more about it. 
 
The person on our team who created the script is currently on leave, but I'll ask him to provide more info if he can when he's back. That won't be until next month though. Sorry for the wait!

0


image avatar

James Rodewig

Zendesk Documentation Team

Hi Rebeca,

Sorry to hear you're having to manually update all those links. Sounds exhausting!

If you haven't yet, I recommend reading our Using the Help Center API to manage article translations article in the Developer Docs. It gives you some tips for using code to handle your help center translations. We tried to make the article beginner-friendly, so I hope it's useful even if you don't have any prior programming experience.

Toward the end of the article, there's a section that covers uploading translations as a deliverable. If you're uploading translations from JSON like in the article, you can add a line to the Python script in that section to update Help Center links in your translations. The line essentially finds and replaces /hc/en-us/ in your translations with /hc/{locale}/.

Here's the modified script (the new line starts with article['body']):

import json

import requests

auth = ('your_email', 'your_password')

print('- reading deliverable file')

with open('2021-04-15_deliverable.json', mode='r', encoding='utf-8') as f:

deliverable = json.load(f)

for locale in deliverable:

print(f'\n- uploading {locale} translations')

for article in deliverable[locale]:

article_id = article['id']

article['body'] = article['body'].replace('/hc/en-us', '/hc/' + str(locale))

# get missing translations to determine if should use a PUT or POST request

url = f'https://example.zendesk.com/api/v2/help_center/articles/{article_id}/translations/missing.json'

response = requests.get(url, auth=auth).json()

missing_translations = response['locales']

if locale in missing_translations:

# new translation -> do a POST request

print(f' - posting translation for article {article_id}')

post_url = f'https://example.zendesk.com/api/v2/help_center/articles/{article_id}/translations.json'

data = {'translation': {'locale': locale, 'title': article['title'], 'body': article['body']}}

response = requests.post(post_url, json=data, auth=auth)

else:

# existing translation -> do a PUT request

print(f' - putting translation for article {article_id}')

put_url = f'https://example.zendesk.com/api/v2/help_center/articles/{article_id}/translations/{locale}.json'

data = {'translation': {'title': article['title'], 'body': article['body']}}

response = requests.put(put_url, json=data, auth=auth)


As a note, there is a typo in the article snippet (https://example.zendesk.com is written as https://example.zendesk.com.zendesk.com). I fixed the typo in the script above and will update the article shortly.

I hope that helps! 

2


James Rodewig this is great, thank you so much for the help.

0


James Rodewig I was looking into this code, for translations, we use the tool Lingpad to pull the content, translate and then push the content back to Zendesk Guide, would this code be applicable for something like this?

Thanks in advance!

0


image avatar

James Rodewig

Zendesk Documentation Team

Hi Rebeca,

Unfortunately, I'm not familiar with Lingpad or how they push translations to your help center.

However, you can use the following Python script to update links in translated articles once they're in your help center (likely after Lingpad pushes the content):

import requests

auth = ('your_email', 'your_password')
subdomain = 'your_zendesk_subdomain'
article_ids = ['1', '2'] # Article ids to update

# Get a list of locales for the help center, excluding the default locale
url = f'https://{subdomain}.zendesk.com/api/v2/help_center/locales'
response = requests.get(url, auth=auth).json()
locales = response['locales']
default_locale = response['default_locale']
locales.remove(default_locale)

for article_id in article_ids:
for locale in locales:

# Get the translation for the article
get_url = f'https://{subdomain}.zendesk.com/api/v2/help_center/articles/{article_id}/translations/{locale}.json'
get_response = requests.get(get_url, auth=auth).json()
translation_body = get_response['translation']['body']

# Update help center links in the translation
print(f'article {article_id}: Updating links for {locale} translation')
put_url = f'https://{subdomain}.zendesk.com/api/v2/help_center/articles/{article_id}/translations/{locale}.json'
translation_body = translation_body.replace('/hc/' + str(default_locale), '/hc/' + str(locale))
data = {'translation': { 'body': translation_body}}
requests.put(put_url, json=data, auth=auth)


Unlike the previous script, this one doesn't require a JSON file containing the translations. Instead, you just need to replace the auth, subdomain, and article_ids values at the top of the file with your own values. article_ids should contain the list of article ids you'd like to update.

I suggest trying this script out with a test article (or even a test account) before using it in production or on a larger scale.

Please also note that we can't guarantee the above code or provide support for the script. However, I hope it's enough to get you started and help you explore the Help Center APIs on your own.

Best of luck!

0


Hi,

Is it possible from a Category page to link to another section page that is not in that Category?

For example, imagine I had 2 Categories called Desktop and Mobile. Under Mobile I have Android and iOS. When I select the Desktop link, is it possible to have a direct link to the Mobile Category page in there, or it's sections (Android and iOS), as opposed to having to go back and select the initial Mobile page itself?

I don't want the link to be in an article - just a header section itself if possible like my attached mock up.

The use case here is we have multiple sections across our site for one product and we are wondering if it's possible to have links to all these sections on one single page without having to create the sections themselves on that specific page.

Thanks,

0


I can't attach my mock up for some reason.

0


image avatar

Christopher Kennedy

Zendesk Developer Advocacy

Hi Stuart,
 
It's definitely possible to do this within the category page template.  To do so, use the if helper to check the current category and conditionally render a link to the other category.  For example, the following does this in your Desktop or Mobile example:
 
{{#is category.name 'Desktop Category Name'}}
<a href="mobile-category-URL">Mobile Category Name</a>
{{else}}
<a href="desktop-category-URL">Desktop Category Name</a>
{{/is}}
 
 

0


Can you insert Guide articles easily into Agent Live Chats?

1


A hashtag appears at the end of every Heading 2 link we insert -- does anyone know why? This occurs regardless of whether it is linked/unlinked, viewed as an agent/admin or end-user.

0


Hi Megha, thanks for your question
 
I've just checked with the default Copenhagen theme and there is no hashtag for me.
It's probably related to your theme. I would recommend to check the CSS file on this one. You can temporarily switch to the default theme to confirm that it is related to your theme.
 
Movell, you can enable the article recommandations in the Classic widget (Enabling Article Recommendations in Web Widget (Classic)).
If your question is more how an agent can easily insert an article link, the best option is our Knowledge Capture app (available for Chat sessions in Agent Workspace).
 
Hope it helps :-) 

0


Can you insert Guide articles easily into Agent Live Chats?

0


Hi Movell, the solution mentioned above works only with Agent Workspace (Migrating to the Zendesk Agent Workspace). 
If your instance is configured with the standard agent interface, I'm afraid there is no option to easily insert links to the guide (except copy/paste the links).

0


Please sign in to leave a comment.