共用方式為


Simple way to hide Suite Links

Suite Links is where you see "Newsfeed, SkyDrive, Sites" on your SharePoint site's top right corner.

Courtesy of https://www.learningsharepoint.com/2012/08/09/sharepoint-2013-hide-newsfeed-skydrive-sites-deltasuitelinks/, you can inject a snippet of JavaScript to simply hide the DIV containing the links. However, the DIV's name has changed since the blog was publishing. Below is the correct script to do the job:

<script type='text/javascript'>// <![CDATA[
_spBodyOnLoadFunctionNames.push("HideBrandingsuite");
function HideBrandingsuite()
{
 document.getElementById('DeltaSuiteLinks').style.visibility = 'hidden';
}
// ]]></script>

Notice the name of the DIV has been changed to "DeltaSuiteLinks".

Now, how do we inject above script to a SharePoint site? Of cause you can create a control that includes the script and utilize Delegate Control to put it on your master pages. This is a typical full trust development and requires coding and deploying WSPs on server side. There are two more options that don't require any code development and server side customization:

  1. Simply put a Script Editor web part with the JS code above on the pages you want to hide the links. (This option only works for individual pages)
  2. Modify the master page you use to include the JS code. To do this follow these steps:
    1. Navigate to your site's /_catalogs/masterpage directory and download a copy of the master page of your site (HTML version preferred if that's the case).
    2. If you are using OOTB master page, change the downloaded master's name (we don't want to touch anything that is OOTB).
    3. Open the downloaded master with a HTML editor, insert the code above to the master page and save the changes.
    4. Upload the modified master page back to the site. Switch your site's master page if its name has been changed.
    5. Test the new master page and make sure it works.
    6. Publish the new master page.

Of cause the two options mentioned above are manual work and wouldn't scale for large amount of site collections, in that case you need to create a sandbox or full trust solution to do the job.

Zewei Song, Ph.D.
Microsoft Certified Master: SharePoint 2010
Microsoft Consulting Services

Comments

  • Anonymous
    November 14, 2014
    Beauty - I was looking for this for ages ;) Thanks a lot...