I am using sharepoint 2010 and VS2010.

I have implemented this tutorial for creating a custom web template, and it works:


Now I would like to implement my own masterpage and css file, how to do this on my web template files like below:


What to do in which file?

2 Answers 2


You will need to add MasterUrl attribute to your configuration node and also need to add module element for master page,

Your configuration will look like this,

<Configuration ID=”0” Name=”Default” MasterUrl=”_catalogs/masterpage/project.master“>

and module node will be something like this,

<Module Name=”MasterPage” List=”116” Url=”_catalogs/masterpage” RootWebOnly=”FALSE“>


MSDN Article on how to add custom master page to ONET.xml

also look at this,


You are asking really easy questions that you can easily find answers for, by googling, for example if you put keywords as "ONET.XML master page" it will show you the posts I just mentioned above, I would also recommend you to read a book about SharePoint development like "SharePoint inside"

  • I see 2 differance solutions. First one is add the masterpage under the site definition folder. The second is to map the template/global folder and add the masterpage inside of it. Which one is the best? I try to searching/googling to find my solution, but find inrelevant articles or tutorials. Mostly they are talking about site definition or site templates. I am also reading the book: sharepoint development from wrox.
    – Ola
    Mar 27, 2013 at 21:09
  • one in MSDN article is best one. Mar 27, 2013 at 21:37
  • It doesnt work for me:( I have created a mapped folder to template\globals and add inside of it my custom template with the name test.master. Inside my onet.xml I have replaced v4.master into test.master. I deploy it and when I create a new site collection of this template and try test the site collection, it shows an error on the page. Did I miss something? I didnt do something with <module like you described because I was thinking it is only needed If I implement the other implementation like under the linkname "Source".
    – Ola
    Mar 27, 2013 at 22:29
  • 1
    You will need the module to deploy the custom masterpage
    – Remko
    Nov 17, 2013 at 21:23
  • and here's an example tutorial for that too :) sharepointchick.com/archive/2010/03/26/… Nov 18, 2013 at 9:32

One of the ways:

  1. open your site in SharePoint designer.
  2. copy your v4.master, keep a backup, and create new copy of v4.master and name it your custom.master.
  3. make this master page as default master page and start making changes to this.

Regarding CSS:

  1. Copy your core.css and place it in style library, name it custom CSS and start editing it.

you have to refer this Custom CSS after you refer core.css using link tag, because css work on last come first serve basis so last one loaded gets applied to site.

Let me know if you need more detail.

  • I dont want to use spd. I would like to build the whole solution in visual studio to deploy it later on the live environment.
    – Ola
    Mar 29, 2013 at 9:15
  • @pibcat, why do you go off-topic when the guy states clearly that he is trying to create a custom web template? You can't do that with SPD.
    – Imir Hoxha
    Oct 19, 2015 at 19:24

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.