Change SharePoint 2013 Site Logo Link to Root Site URL
By default, on clicking the SharePoint 2010 or SharePoint 2013 site logo - It takes us to the root of the current site or sub-site. But you may want to link logo to top level site.Well, to change this behavior you got to change the master page.
Set SharePoint 2010 logo link root site:
Important: Since this is a Master page change, You have to apply the updated master page to all site collections for the changes to take effect!
Set SharePoint 2010 logo link root site:
- Open your Master page in SharePoint Designer 2010, Locate the below line:
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitleGraphic">
- Replace the ~site value with ~sitecollection .Save and close the master page (approve and publish, if required!) . This changes SharePoint 2010 logo link to root site collection.
- Open your SharePoint 2013 site in SharePoint designer 2013, Edit the master page in "Advanced Edit Mode",
- Locate the following code :
<SharePoint:SPSimpleSiteLink CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" > <SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=23" runat="server"/> </SharePoint:SPSimpleSiteLink>
- Replace the control <SharePoint:SPSimpleSiteLink> with <SharePoint:SPLinkButton> and add the "NavigateUrl="~sitecollection/" attribute to it.Here is the modified code:
<SharePoint:SPLinkButton NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" > <SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=23" runat="server"/> </SharePoint:SPLinkButton >This changes logo link URL pointing from current site to Root Site!
What about redirecting it to a site page? The site Home page
ReplyDelete**In javascript :**
ReplyDeleteUsing SP Chrome editor, upload a file in style library and script link to this js.
Edit the JS and add :
window.onload = function(){
Var urlLogo = "/sites/xx/xx/xx";
document.getElementById("ctl00_onetidProjectPropertyTitleGraphic").href = urlLogo;
}
Thanks for posting this. However, despite following all these steps and editing the master pages on SharePoint Design Manager, I'm still unable to see the changes being applied to the SharePoint site. Any thoughts on what needs to be done additionally? I greatly appreciate your help.
ReplyDeleteTry checking the page in and approving it.
DeleteI followed all the steps and published but it still doesn't work.
ReplyDelete