0

I have created and saved a Team Site template. When a user creates a new site using this template, I want to ensure the Parent's Master Page is inherited automatically. This is not currently happening even though I saved the template with the publishing feature enabled and the master page set.

What is the best route for activating the feature and setting the MP? If it includes an event receiver, pls show me how to create and attach to the template.

Michael Colbs
  • 3,919
  • 2
  • 48
  • 96

1 Answers1

1

Write a web provisioned event receiver and set the child site master page to parent site's. This way you need not activate Publishing feature on team site

In Visual studio: Create Event receiver. Choose event to be "Web was provisioned"

Robert Lindgren
  • 24,520
  • 12
  • 53
  • 79
  • yes, this is what ended up doing.. Very simple public override void WebProvisioned(SPWebEventProperties properties) { SPWeb web = properties.Web; web.CustomMasterUrl = "/_catalogs/masterpage/custom.master"; web.Update(); base.WebProvisioned(properties); } – Michael Colbs Jun 26 '14 at 17:13