How to change master page of default.aspx in a site template

rajasoorya_kc
rajasoorya_kc used Ask the Experts™
on
Hi,
I have a custom site template definition which has a default.aspx. I want to use a different master page instead of the default one. How can this be done??
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
I tried both the URLs and also http://www.sharepointkings.com/2008/05/how-to-set-custom-master-page-as.html.
But nothing seems to work out.
Also lets say you created the site based on your custom site template. Goto site settings and in Master page you can change it to whatever you like.

Author

Commented:
I did all the changes as suggested and i still see that my page is picking the "BlueBand.master" as the master page. But i dont see the reference in any of the "onet.xml" files. Why is "BlueBand.master" being picked?

Author

Commented:
I think i found what the issue is. I sense that Url="_catalogs/masterpage" in the modules tag is actually looking for the master page in the path _catalogs/masterpage of the site instead of the sitecollection.

How can i give a relative path to refer to the _catalog/masterpage of the sitecollection?
<Modules>
  <Module Name="CustomTemplateCustomMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE" Path="">
    <File Url="default.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" /> 
  </Module>

Open in new window

Did you try adding the URL of your site collection inside [Path=""]?  I would try that first.

Author

Commented:
No I didnt.
My question may sound dumb, but a rookie to moss. When you say "URL of the site collection" are u talking about the http://... url or some relative path?
There are no dumb questions, only dumb answers.

I was talking about the http://site.collection.com/site1/ URL
Hi all,
I was able to resolve the issue by entering the value for the property key=ChromeMasterUrl with the URL of my custom master page.
Thanks for all your responses.

Special thanks to Nubian and Pramod. The URL references helped me understand the issue better.
<Configurations> 
    <Configuration ID="2" Name="BLANKINTERNET" MasterUrl="_catalogs/masterpage/customdefault.master" CustomMasterUrl="_catalogs/masterpage/customdefault.master">
      <WebFeatures>
        <Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" />
        <Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" />
        <Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" />
        <Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" />
        <Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" />
        <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/customdefault.master" />
            <Property Key="WelcomePageUrl" Value="Pages/BlankPage.aspx" />
            <Property Key="PagesListUrl" Value="" />
            <Property Key="AvailableWebTemplates" Value="" />
            <Property Key="AvailablePageLayouts" Value="" />
            <Property Key="AlternateCssUrl" Value="" />
            <Property Key="SimplePublishing" Value="false" />
          </Properties>
        </Feature>
      </WebFeatures>
    </Configuration>
</Configurations> 

Open in new window

Congrats on locking this down yourself!  

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial