0

I have created a site based on the standard blog site, with the following changes:

  1. I created two new master pages; default.master (set as default) and custom.master (set as custom).
  2. I pointed a number of pages (such as default.aspx) to the default.master page
  3. I then modified some of the list forms to point to the custom.master page

This all works very well, and as expected.

Now, I have saved this site as a template with which I can generate new sites from. However, when I create a new site from this template, this new site seems to set default.master as both the Default and Custom master page. How can I get the template to correctly remember which of the master pages should be set to default, and which is set to custom?

2

Turns out that when I was saving a site as a template, SharePoint forgot to put the CustomMasterUrl attribute into the configuration section of the ONet.xml file.

I had to export the site template (as a WSP file) and import that file into Visual Studio 2010. Then I added the missing attribute, so the full string was as follows:

<Configuration ID="0" Name="Default" MasterUrl="_catalogs/masterpage/default.master" CustomMasterUrl="_catalogs/masterpage/custom.master" ThemedCssFolderUrl="">

I then published a new WSP file and uploaded it to the SharePoint solution gallery. Now new sites generated from my template behave correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.