I am working on branding SharePoint 2016 suit bar where I have below requirement.
- I need to replace left side SharePoint text with icon with company url.
- 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
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 page
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>