Question

What are the benefits of adding a master page via module when compared to adding it via code?

I think traditionally it has been added via Modules but now the cloud and remote provisioning recommendations might be changing the best practices (?)

Was it helpful?

Solution

You can deploy it always with a module no matter if you are in an on-premis installation or in the cloud. As long as you make sure the right file is in the master page gallery.

The benefit of a module is that in an on premise installation you can make it ghostable which means the master page always would be loaded from the file system. In case of an upgrade you don't ned to take care that the correct master page file is loaded, checked-in and updated.

In case of a sandbox solution you might needs some additional code that handle the upgrade and installation:

  • Upload the correct file to the master page gallery
  • Auto-checkin and Approve the master page
  • Handle the overwrite of the currently existing file with the new one

Another possible new ways is a SharePoint App to provision the branding. You will find great information on that on Breaking grounds: packaging and selling your SharePoint 2013 branding as an app !

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top