0

I am working on branding SharePoint 2016 suit bar where I have below requirement.

  1. I need to replace left side SharePoint text with icon with company url.
  2. On right side of suit bar I need to add additional links with sub menu items under it.

I have used below reference article to override the SuiteBarBrandingDelegate and SuiteLinksDelegate controls in SharePoint 2016 onpremise environment but change doesnt seem to take any effect. Any one has any idea whether the delegate controls are still valid in SharePoint 2016

http://www.c-sharpcorner.com/UploadFile/sagarp/implement-custom-suitebarbranding-delegate-control-in-sharep/

Environment: SharePoint 2016 On Premise.

PS: I have jquery solution to do above functionality but the issue is the controls replaced only after the page is fully rendered. Attached html structure of 2016 seattle master pageenter image description here

UserControl Code:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SuiteBarBrandingDelegateCtrl.ascx.cs" Inherits="CustomSuiteBarBrandingDelegate.ControlTemplates.CustomSuiteBarBrandingDelegate.SuiteBarBrandingDelegateCtrl" %>


using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint.Portal.WebControls;

namespace CustomSuiteBarBrandingDelegate.ControlTemplates.CustomSuiteBarBrandingDelegate
{
    public partial class SuiteBarBrandingDelegateCtrl : MySuiteLinksUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected override void Render(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Style);
            writer.Write(".o365cs - nav - brandingText { display: inline - block; }");
            writer.RenderEndTag();
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "o365cs - nav - brandingText");
            writer.Write("< img src ='https://babc/bcit_Logo.png' />");
            base.Render(writer);
        }
    }
}

Element.xml

<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Control Id="SuiteBarBrandingDelegate"
  Sequence="9"
ControlSrc="/_ControlTemplates/15/CustomSuiteBarBrandingDelegate/SuiteBarBrandingDelegateCtrl.ascx">
  </Control>
</Elements>
2
  • did you ever solve this?
    – chicken
    Aug 8, 2017 at 4:13
  • No, Existing delegate controls didnt work for 2016 on premise. I ended up using client side JS solution to add custom links. Aug 8, 2017 at 15:34

1 Answer 1

0

Need to see more of the code you are using to comment on the issue. (e.g. are you using 2016 references like ControlAssembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" )

Moreover, with SharePoint 2016, there are PowerShell commands now available to achieve this:

$web = Get-SPWebApplication "http://mywebapp"
$web.SuiteNavBrandingLogoNavigationUrl ="http://mywebapp.sharepoint.com"
$web.SuiteNavBrandingLogoTitle = "MyWebApp"
$web.SuiteNavBrandingLogoUrl = "<<logo url>>"
$web.SuiteNavBrandingText ="MyNavText"
$web.Update()
1
  • Hi Ransher, I had added code for better understanding and I am using 2016 assemblies. Powershell script can only useful for one of my requirement for replacing the text with image but not other requirement. I can also see the icon comes in the center not the left. social.technet.microsoft.com/wiki/contents/articles/… Jun 15, 2017 at 19:23

Your Answer

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

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