1

Using the following guide: http://blogs.msdn.com/b/findnavish/archive/2013/02/07/sharepoint-2013-customizing-suite-bar.aspx I've added some custom links to the suite bar, the main code from my control is as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebControls;
using System.Globalization;
using System.IO;
using System.Collections;
using Microsoft.SharePoint.Portal;
using Microsoft.SharePoint.Portal.WebControls;

namespace SPDev.SharePoint2013.SuiteBar.ControlTemplates.CCQ.SharePoint2013.SuiteBar
{
    public partial class SuiteLinksDelegateCtrl : MySuiteLinksUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected override void Render(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Style);
            writer.Write(".ms-core-suiteLinkList {display: inline-block;}");
            writer.RenderEndTag();
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "ms-core-suiteLinkList");
            writer.RenderBeginTag(HtmlTextWriterTag.Ul);

            RenderSuiteLink(writer, "http://connx/", "Payroll (ConnX)", "lnkSearchLink", false);
            RenderSuiteLink(writer, "http://vshopracc03/BP/Employee/Requisition%20Management%20Pages/Purchase%20Requests.aspx", "Requisition Manager", "lnkSearchLink", false);

            writer.RenderEndTag();
            base.Render(writer);
        }
    }
}

Although this works great, and adds some menu items - I'd like to also remove Skydrive and Newsfeed without having to deploy another farm solution (I figure housing all of this in one feature is definitely a better practice). Is this possible?

1

It is the Sequence number in the Elements.xml that controls where your Delegate will be shot in. By playing with this number, start with 1 and go upwards, you can see when you are replacing the existing one.

When you are replacing the existing one, you will have to recreate the nodes you want to keep, I did this when 2013 was new (but no longer has the code) by using a .Net Reflector tool to see how SharePoint creates the nodes (complete with Current node indication).

  • Robert, this feels kind of like a workaround. Do you know of a way to actually remove a link from the suite bar? Old question I know, but thought you might have an alternative solution being 2 years more experienced now :) – Submits May 28 '15 at 15:23
  • This is still the way to actually remove nodes in a clean way. But if you just want to hide nodes you can do it with CSS or JS (which to me is a dirtier way) – Robert Lindgren May 28 '15 at 16:08
  • You're right Robert. Since yesterday I've been playing around and managed to output the HTML nodes and seen what they look like. Found a nice example on how to manipulate the nodes to remove the link you don't want by looking for "ShellDocuments" or "ShellSites" in the node HTML: stackoverflow.com/questions/14725720/… – Submits May 29 '15 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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