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 http://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 http://myservernamehere


#Add Logo
$webapp.SuiteBarBrandingElementHtml = ‘<div class=”ms-core-brandingText”><a href=”http://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 http://myservernamehere


#Add Banner
$webapp.SuiteBarBrandingElementHtml = ‘<div class=”ms-verticalAlignMiddle”><a href=”http://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.

 


Comments (0)

Skip to main content