简体   繁体   中英

Sharepoint 2016 - One master page for every site

I am currently working on a SharePoint 2016 system. We are upgrading from a SharePoint 2010 where we had one master page. Our goal is to have a single master page for every site in our environment. We can't use publishing to do this since we need site templates. So that route is out.

If possible I am looking for a way to catch, perhaps via a feature, when the masterpage is loading and redirect it to use custom master page. I haven't been able to find an event that I can use to do this.

Note: This is an onsite installation and not office 365.

Any help would be much appreciated.

After a long while we finally settled on a solution. We created two features. One for the site collection and one for SharePoint Central Administration.

The site collection feature forces all children sites to update their master page to a specific one. It also adds event listeners for new sites so that they also point to the correct master page.

The web app feature is used as a "switch". When it gets enabled it activates the site collection feature. When it gets disabled then it deactivates the site collection feature.

It's not a super great solution. However I thought I might post it here for those that are unable to move away from SharePoint (like us).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM