Introduction
By default, the logo on modern sites redirects the users to the site Home Page.
If you would like to change that and make it redirect users to another address, here is what you can do.
Before we begin
- This article is for Office 365 and SharePoint 2019 environments.
- This article is for Modern SharePoint Experience.
- You need to have ShortPoint SPFx installed in your environment.
Step 1. Modify the JS code
Here is the JavaScript code that will tell the logo element to redirect users to ShortPoint official web page after you click it:
Office 365 environment:
shortpoint.$( document ).ready(function() {
shortpoint.$('[class*="logoWrapper"]').attr('href', 'https://www.shortpoint.com');
});
SharePoint 2019:
shortpoint.$( document ).ready(function() {
shortpoint.$('.ms-siteLogo-defaultLogo').attr('href', 'https://www.shortpoint.com');
});
Please modify the www.shortpoint.com part: change it to your desired link. Copy it after it's ready.
Step 2. Insert the code into ShortPoint Theme Builder
Now open the Modern Theme Builder (Site Contents > ShortPoint Dashboard > Theme Builder > Modern).
Go to Utilities > Custom JS.
Paste the code to the box:
Click Apply and Publish.
After the page is published, please refresh the page.
That's it! Now, the logo will redirect you to where you have asked it to.
Related articles: