Recent searches


No recent searches

Tip: How to change the url of the logo of your Help Center



image avatar

Trapta Singh

Zendesk LuminaryCommunity Moderator

Posted Jul 30, 2021

This tip will help you to change the URL of the logo of your help centre. You must have access to edit the code in order to do so.

Without further ado let's dive in:

Edit your header.hbs file and replace

{{#link 'help_center'}}
<img src="{{settings.logo}}" alt="{{t 'home_page' name=help_center.name}}" />
{{#if settings.show_brand_name}}
<span aria-hidden="true">{{help_center.name}}</span>
{{/if}}
{{/link}}

with

<a href="URL" target="_blank">
<img src="{{settings.logo}}" alt="{{t 'home_page' name=help_center.name}}" />
{{#if settings.show_brand_name}}
<span aria-hidden="true">{{help_center.name}}</span>
{{/if}}
</a>

You can replace the URL with the link you want to add.

The above code should change the URL of the logo and should redirect the user to your wanted link which will get opened in a new tab.

Let us know how it goes for you.

Thanks


3

4

4 comments

Hi Trapta,

Do you know if it is possible to change the link depending on the page you're visiting?

For example, if I'm on the Community pages, can I make the logo link to the Community homepage rather than it go to the Help Center homepage? Is there an if statement that could handle this?

For branding purposes we're looking to cut the ties between our HC and Community which we can't do at the moment as it links back to the HC when clicking the logo in the top-left.

Thanks, Danny

0


image avatar

Trapta Singh

Zendesk LuminaryCommunity Moderator

Hi Daniel Cowlishaw,

Try putting the below code at the bottom of your script.js file

document.addEventListener('DOMContentLoaded', function() {
function isCommunityTemplate() {
if ( window.location.href.indexOf('community') > -1 ) {
return true;
}
}

var isCommunityPage = isCommunityTemplate();
if ( isCommunityPage != undefined && isCommunityPage == true ) {
var curLocale = document.getElementsByTagName('html')[0].getAttribute('lang').toLowerCase();
document.getElementsByClassName('logo')[0].children[0].setAttribute('href', '/hc/'+ curLocale +'/community/topics');
}

});

Let us know if this works for you.

Thanks

0


Hi Team,

I would like to know if it's possible to change the URL of the"HiCircle"in red? We are not going to build a help center but just would like to make sure of the zendesk form, thanks!

 

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey Ashley,
 
The link you're referring to is generated by the breadcrumbs helper. The URL can't be changed directly via the helper but you'll be able to change the anchor href by adding some custom Javascript code in the script.js file in Guide Admin.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post