0

I need to add a link to the very top (black bar) on SharePoint 2016 instead of the Suitebar. I'd hate to edit the Masterpage. Has anyone ever done this?

Bismarck

4
  • Are you looking to do it across the site collection, or just a few pages?
    – KGlasier
    Oct 3, 2019 at 14:53
  • I am looking to do across the whole farm so its on every page. I don't have enough room on the Suitebar to keep it responsive so I'm looking at the black bar above it.
    – Bismarck
    Oct 3, 2019 at 15:00
  • I’d look at adding a js link to the masterpage to dynamically add links or other content across the farm and then you can just update that JS file when you need to update rather than the masterpage itself
    – KGlasier
    Oct 3, 2019 at 15:02
  • Thanks, I will try that.
    – Bismarck
    Oct 3, 2019 at 15:07

2 Answers 2

0

What about this powershell?

    $wa = Get-SPWebApplication "https://pippo.pluto.it"
    $wa.SuiteNavBrandingLogoNavigationUrl = "/"
    $wa.SuiteNavBrandingLogoTitle = "Torna all'home page"
    $wa.SuiteNavBrandingLogoUrl = "/SiteAssets/Logo.png" 
    $wa.Update()

enter image description here

4
  • Maurizio, I think this just puts it in the Suite Bar, not the Bar above it. Am I wrong?
    – Bismarck
    Oct 3, 2019 at 19:34
  • Isn't it the black bar? see the image i've added
    – Maurizio
    Oct 4, 2019 at 8:18
  • Yes, that appears to work, I just need to move it to the right side instead of in the middle.
    – Bismarck
    Oct 7, 2019 at 17:31
  • I don't think is possible only with powershell
    – Maurizio
    Oct 9, 2019 at 13:58
0

I can't say for sure if this works for SharePoint 2016, but it does work for SharePoint 2013, and affects the Web Application:

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$webApp = Get-SPWebApplication https://SHAREPOINT
$HTML = @'
 <script>
 document.addEventListener("DOMContentLoaded", function(event){
 var ul = document.getElementsByClassName("ms-core-suiteLinkList"); 
 var li = document.createElement("li");
 li.innerHTML = '<a class="ms-core-suiteLink-a" id="ctl00_ctl45_ShellHome" href="https://SHAREPOINT/Pages/default.aspx"><span>Home</span></a>';
 li.setAttribute('class','ms-core-suiteLink');
 ul[0].insertBefore(li, ul[0].childNodes[0]);
 });
 </script>
 <div class='ms-core-brandingText'>SharePoint</div>
'@

$webApp.SuiteBarBrandingElementHtml = $HTML
$webApp.Update()
$webApp = Get-SPWebApplication https://SHAREPOINT
$webApp.SuiteBarBrandingElementHtml = $HTML
$webApp.Update()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.