Recent searches


No recent searches

Change text for "My Activities" in HC



Posted Oct 24, 2013

I've seen this question posted quite a bit in the forums, so here is a little how-to on how to change the string for 'My Activities' in HC, as done on http://support.amilia.com

Here's how to change the "My Activities" text

  1. In Guide, click the Customize design icon in the sidebar
  2. Click on Edit Theme to access your template's code
  3. Click the script.js file and add the following code:

//Change string for My Activities

$('.user-nav .my-activities').html(' See my requests');
$('.sub-nav').find('li').filter(":last");

As you see, this allows you to change the string to "See my requests"

Here's how to change the text in multiple languages

Follow the steps above but use this code: 

if(currentLanguage === 'Français') {
$('.user-nav .my-activities').html(' Voir mes demandes');
$('.sub-nav').find('li').filter(":last");
}

 This automatically updates the user drop-down menu and the subnav breadcrumbs as well!

Here's what it looks like!


0

35

35 comments

Update: I am currently modifying this code + the code for personalized breadcrumbs in HC so that they are all updated with appropriate encoding and reflect the page navigation. Please to stand by!

0


image avatar

ModeratorWes

Most Engaged Member of All Time - 2021

@Andrea - thanks for the updates, you've been very busy today!!

0


Not me, the props go to my team :) I just learn, post, and share with you guys!

0


Just updated it - 

subnav breadcrumb should show

$('.sub-nav').find('li').filter(":last");

0


Hello,

I am going mad trying to figure out a little issue I am having with the cache storing our SSO sessions after a user is authenticated from our SSO script. Once a user logs into the Help Center, they are unable to click on the Sign Out link from the {{user-nav}} drop-down menu.

I figured out (more or less) how to resolved this, but sadly I am stuck.
Essentially, the URL when clicked is "/access/logout" the authenticated user is kicked to the home page and then continues to be authenticated.
This can be resolved if I could only figure out how to replace the URL with "/access/logout.json".
I found the article below on how to change the text for My Activities... arg..... Please help if you can! Would much appreciate it.

Here's how to change the "My Activities" text
1) At the bottom of your HC, click on Customize Design
2) Click on Edit Theme to access your template's code

3) Navigate to the JS tab and add the following code:

//Change string for My Activities
$('.user-nav .my-activities').html(' See my requests');

$('.sub-nav').find('li').filter(":last");

Failed Attempt:
//Change string for anchor tag to force logout
$('.user-nav .li a').html('/access/logout.json');
$('.sub-nav').find('li a').filter("/access/logout");

 

0


Hi Justin,

I'm not sure that this approach is correct for changing the URL that the Sign Out link goes to. The example from Andrea is for replacing the displayed text, not modifying where this link goes. Since you have JWT set up, you may want to review where your Remote logout URL is pointing to. That setting is located here: Admin>Settings>Security. It sounds like your users are getting directed to the remote logout URL, your script determines that they are authenticated and then sends them right back to Zendesk. If that is the case you may need to modify your authentication script. You can find good examples here:

https://github.com/zendesk/zendesk_jwt_sso_examples

0


Thanks for jumping in Bob.

@Justin - as Bob said, this tutorial is simply for changing the text name, not where the link goes. 

0


Thanks for the details on changing My Activites!

0


Thanks gang. Is there any possibility this workaround only works with certain themes? Or perhaps things have changed in the last few months which prevents the js tweak from working? I can't get it to take.

0


Hi Jon,

What theme are you using? 

0


Thanks much Andrea!

We're using "The Humble Squid" with some light customizations.

0


Hi Jon,

I got it to work. Make sure you add it after the last bracket

See image attached:

 

0


Hi Andrea. I'm a bonehead. You were right on. Thanks for the assist and have a great day.

0


That makes us both boneheads, cause it took me a second to figure out too :P

Happy Friday!

0


@Andrea - How did you add the "Submit A Request" link next to the "See My Requests" link?

0


@Andrea - Disregard my last comment.

0


This is very helpful, thank you!

0


@Andrea, Do you know how to apply localize to a mailto button?

We are using different languages with different support email, and I want to change the email depending on what language is being used.

0


Is there any way to change the text for all of the following areas? see attachment

0


image avatar

Jessie Schutz

Zendesk Customer Care

Hey Alex!

It may be possible to do this by customizing the code in your Help Center, but that outside my area of expertise. We have several folks here who are good at customizing the Help Center, so hopefully one of them will be able to jump in!

0


I'm also trying to change the text for all the areas Alex Zlatkus asked for, but up till know I could't do it.

0


:( I tried this modification, but where it should say "My Activities" it says "Liquid error: undefined method..."

I added this above snippet after the final closing brackets..

Then Inside the final brackets. Same error.

Now I have removed it altogether, but the error persists across multiple devices.. so its not a cache thing.

I don't know what I did.. here is the js code. perhaps I deleted one character too many.. I didn't grab the code before I started... :/

 

 

0


it seems it was a cache issue. appears to have gone away

 

0


image avatar

Nicole Saunders

Zendesk Community Manager

Glad to hear it seems to have resolved itself. Let us know if you have further questions. 

0


Hi, 

I copied the first code and in the English version it was everything ok, but when I tried to do it for the french one it didn't appear. In fact, now we have only the Eglish text for all the other languages. 

 

May I see how did you insert it to the JS tab? 

 

Thanks!

0


Hi Raquel,

I think that Zendesk has changed how they identify languages, so you may have to use 'fr' or 'en-us' instead of writing it out as 'Français'. 

Hope that helps!

0


I'm having some trouble getting this to work as well. I'm wondering if I'm in the wrong place? I'm not sure where exactly I should be adding those lines of code.

0


image avatar

Nicole Saunders

Zendesk Community Manager

Hey Annie - 

I see that this is your first post - welcome to the Zendesk Community! I've pinged a few folks internally to take a look and see if this article needs updating; we'll get back to you on that once they've had a chance to review it. 

In the meantime, I encourage you to head over to the Welcome thread and introduce yourself. 

0


Great thank you!

0


image avatar

Jennifer Rowe

Zendesk Documentation Team

Hi Annie,

The UI did change back in May so the first step (which is an important one! :) was incorrect. I've updated it, so see if you can get to the right place now to add the code snippet to your Help Center JavaScript code.

This article also describes how to edit the JS, if you need more help.

Let us know how it goes!

0


Post is closed for comments.

Didn't find what you're looking for?

New post