Monday, March 19, 2018

SharePoint TeamSite Branding and Master Page Inheritance Resolved

UPDATE: Check out this strategy I'm taking now 

Out of the box, creating a team site will not inherit the master page of the site collection.

There's a couple of ways to handle this:


  • Occasionally go to the site collection settings, Look and Feel - >Master Page and selecting, Specify a master page to be used by this site and all sites that inherit from it and check on "Reset all subsites to inherit this site's master page setting"
    • Drawback: This only impacts existing sites, but still doesn't handle any new team sites that are created
  • Going to the team site itself and then manually changing the master page at this location /_layouts/ChangeSiteMasterPage.aspx
    • Drawback: Most end users wouldn't know how to do this and it's not accessible directly from the UI
  • Create a team site, update the master page manually, then save it as a site template
    • Drawback: this will not work if the root parent site is a publishing site or the team site has publishing features turned on
  • Remote provisioning
    • Read more here: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/branding-and-site-provisioning-solutions-for-sharepoint
    • Drawback: A little learning curve
I thought about this for a while, and I realized the easiest way is to get some code in a content editor web part onto the teamsite that checks to see if the master page is set, and if not, it sets it. 

I put this in a team site, saved the site as a template, then hid the default team site template from the site collection settings. 


The code is found here: