Share via


Adding a banner to your site collection

Today on, "This should be really easy but it's really not!!!But it really is". We are attempting to add a banner image to the far left hand corner of site collection in SharePoint 2013.

Now it's fairly easy to change the title of your SharePoint 2013 site collection using the below PowerShell command:

Add-PSSnapin Microsoft.SharePoint.PowerShell #Get your site$webapp = Get-SPWebApplication "https://myservernamehere"#Add Text$webapp.SuiteBarBrandingElementHtml = '<div class="ms-core-brandingText">What's Our New Site Title</div>' #Update Site$webapp.Update ()

It's also very easy to change the site logo using the below PowerShell command:

Add-PSSnapin Microsoft.SharePoint.PowerShell #Get your site$webapp = Get-SPWebApplication "https://myservernamehere"#Add Logo$webapp.SuiteBarBrandingElementHtml = '<div class="ms-core-brandingText"><a href="https://myservernamehere"><img src="/SiteCollectionImages/logo.png" /></a></div>' #Update Site$webapp.Update ()

After doing a little research, I have found that it's just as easy to add that left banner to the site collection using the below PowerShell command:

Add-PSSnapin Microsoft.SharePoint.PowerShell #Get your site$webapp = Get-SPWebApplication "https://myservernamehere"#Add Banner$webapp.SuiteBarBrandingElementHtml = '<div class="ms-verticalAlignMiddle"><a href="https://myservernamehere"><img src="/SiteCollectionImages/banner.png" /></a></div>' #Update Site$webapp.Update ()

The Breakdown:

To align a banner or graphic to the far left (with no spacing), we need use the ms-verticalAlignMiddle div class.