Question

I have created subsites below my main SharePoint Online site, and I want to use the "modern" style to them (as their respective start page). No custom master page involved.

On clicking the logo top left, I am by default directed to the subsite itself, but I want to be directed to the main site again, like a Home link. This should be very simple. But what is the simplest way?

EDIT: I realize that I need to make an spfx extension or spfx webpart to accomplish this, for a "modern" page. Any guidance is welcome. Maybe something like the old script editor is the way to do it?

Was it helpful?

Solution

There seems to be no solution to this other than altering the masterpage or adding custom javascript (spfx extensions for modern) that changes the url every time a user loads the subsite.

I would recommend that you start here: Getting started. You would probably end up putting it in the top placeholder with code that replaces the href tag on the anchor element. Something like this.

var logoLink = document.querySelector('a.ms-siteLogo-defaultLogo');
logoLink.href = 'https://sitecollectionurl.sharepoint.com/sites/a';

Have a look in this sharepoint stackexchange thread where exactly this question has been answered but for classic experience: Change the location that the site page logo points to.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top