3

I have created a Custom Master Page in VS2010 and deploy Project to SharePoint. First I activated site Collection feature "SharePoint Server Publishing Infrastructure" and then i also activated site feature "SharePoint Server Publishing". After that Under "Look and Feel" category, I click Master page. But in site Master page settings, only site master page v4.master was available but my custom Master page was not listed there.

Can anybody explain why it is not listed there ? Whats missing ??

5
  • 1
    Did you create a module, to deploy the master page to the master page gallery? If yes, could you provide also the CAML definition of the module?
    – Norbert
    Commented Dec 13, 2012 at 15:36
  • Yes, I create module to deploy master page. But my Master page is not available in master page gallery also. As i am new to SharePoint, Can you please tell me How i can get CAML defination of the Module ?
    – SPBeginer
    Commented Dec 13, 2012 at 16:02
  • In Visual Studio, double click on your Module file. It should take you to an Elements.xml file. The part between the <Module>...</Module> tags is what is interesting in this case.
    – Norbert
    Commented Dec 13, 2012 at 16:06
  • Thanks! This is: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="schemas.microsoft.com/sharepoint"> <Module Name="MasterPage" Url="_catalogs/masterpage" RootWebOnly="TRUE" List="116"> <File Path="MasterPage\AndraAPFonden.master" Url="AndraAPFonden.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" /> </Module> </Elements>
    – SPBeginer
    Commented Dec 13, 2012 at 16:18
  • The module definition seems correct. What is the scope of the feature which deploys this module? Did you activate the feature or did you check it's activated?
    – Norbert
    Commented Dec 13, 2012 at 16:30

1 Answer 1

2

This elements file works for newcustom.master, it needs to be a web feature and then published from the master page catalogue. You will need publishing infrastructure at the minimum to activate it also.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPage" Url="_catalogs/masterpage">
    <File Url="newcustom.master" Type="GhostableInLibrary" Path="MasterPage\newcustom.master">
      <Property Name="MasterPageDescription" Value="This is the master page to use for the new site." />
      <Property Name="ContentType" Value="$Resources:cmscore,contenttype_masterpage_name;" />
      <Property Name="UIVersion" Value="4" />
    </File>
  </Module>
</Elements>

Tested in SandBox and SharePoint Online.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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