[SalesForce] How to change the url redirect of a Communities Logo

In Communities, within the template, when you select a Company logo, clicking on the logo will always redirect you back to the communtiy home page. I am trying to figure out how to change this to redirect to a new weblink. Has anyone else ever done this? If so, how did you go about it?

Best Answer

There might be alternatives, but the below appraoch worked for me.

  1. navigate to the community.
  2. Open the community experience builder
  3. Go to settings
  4. Choose Advanced Scroll down to Head Markup and click on Edit Head Markup and in the opened window try the below script:

< script > window.onload = function() {document.getElementsByClassName(""logoImage "")[0].addEventListener(""click "",function() {location.href = ""https: //www.google.com""; });}< /script >

This helped to navigate to the external URL. Note: As I am using the www.google.com , this site needs to be add to the CSP trusted sites(Setup> CSP Trusted Sites> new > add the name and the URL that you are using> click save)

You can test this implemented functionality with my community url: https://anu98pcomm-developer-edition.ap16.force.com

I have used this post for Reference

Related Topic