I’m working on a sharepoint 2010 publishing site that has many subsites. I’ve set up a custom master page, and several custom page layouts.
I’ve discovered how to set the default page layout used for newly created pages in a subsite (found at /_Layouts/AreaTemplateSettings.aspx), but I can’t seem to figure out how to specify the default page layout used to create ~/Pages/default.aspx when I create a new subsite.
Right now it selects WelcomeLinks.aspx, and that’s not what I want.
Is this only available if I deploy custom master pages / layouts via code, and if so, does anyone have any good examples?
Thanks.
You don’t need to deploy a custom page layout but you do need to use code. The way we have solved this is to create an Event Receiver for the WebProvisioned event which will fire after a new SPWeb has been created.
What you can do is to update the PublishingPage in the new web with the Page Layout that you want. This allows users to create new webs but you to set the default Page Layout of each new web.
This is the event receiver code:
And this is the code to register the event receiver (this can be run when your feature is activated or can be run once from a PowerShell script or console application):