Question

I'm trying to create a site definition that uses a custom master page. I created a module in VS, called MasterPages, in which there are two folders (one inside another): _catalogs, masterpage. Within this folder i put my custom master page, socialfeed.master.

This is my Elements.xml Module configuration:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPages" RootWebOnly="TRUE" Url="_catalogs/masterpage">
    <File Path="MasterPages\_catalogs\masterpage\socialFeed.master" Url="socialFeed.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
  </Module>
</Elements>

And this is how i bind my custom master page on my site definition's default page:

<%@ Page language="C#" MasterPageFile="~/_catalogs/masterpage/socialfeed.master" 

I can actually deploy the solution without any problems but when i try create and access a new subsite based on that definition i get an error:

Error=The file /_catalogs/masterpage/socialfeed.master does not exist.  

Could you please help me understand where is the problem?

Was it helpful?

Solution

Your site is getting created so please open the site using SharePoint Designer and check if you can see the master page in the Master Pages libary. Each subsite has its own master page gallery. Copy the master page to that library and your site page should load fine.

OTHER TIPS

The URL of the master page you set in the module is actually socialFeed.master, not cernsocialfeed.master.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top