Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3423416
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:21:08+00:00 2026-05-18T06:21:08+00:00

I’m working on a sharepoint 2010 publishing site that has many subsites. I’ve set

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:21:09+00:00Added an answer on May 18, 2026 at 6:21 am

    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:

    public override void WebProvisioned(SPWebEventProperties properties)
    {
        try
        {
            if (PublishingWeb.IsPublishingWeb(properties.Web))
            {
                PublishingWeb curPubWeb = PublishingWeb.GetPublishingWeb(properties.Web);
    
                foreach (PageLayout curLayout in curPubWeb.GetAvailablePageLayouts())
                {
                    if (curLayout.Name == "DefaultPageLayout.aspx")
                    {
                        foreach (PublishingPage curPage in curPubWeb.GetPublishingPages())
                        {
                            curPage.CheckOut();
                            curPage.Layout = curLayout;
                            curPage.Update();
                            curPage.CheckIn("");
                        }
                        break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            /* Handle exception here */
        }
    }
    

    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):

    using (SPSite topSite = new SPSite("[Site Collection URL]"))
    {
        SPEventReceiverDefinition webEventDef = topSite.EventReceivers.Add();
        webEventDef.Name = "Web Adding Receiver";
        webEventDef.Synchronization = SPEventReceiverSynchronization.Synchronous;
        webEventDef.Type = SPEventReceiverType.WebProvisioned;
        webEventDef.SequenceNumber = 4001;
        webEventDef.Assembly = "MyCustomAssembly, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=123456789";
        webEventDef.Class = "MyCustomAssembly.CustomEvents";
        webEventDef.Data = "Adding publishingwebfeatures";
        webEventDef.Update();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.