Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using sharepoint 2010 and VS2010.

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

http://usmanmughal.wordpress.com/2011/04/26/how-to-create-web-template-in-sharepoint-2010-using-feature/

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

defaultdws.aspx
default.aspx
ONET.xml
elements.xml

What to do in which file?

share|improve this question

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“>

Source

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

also look at this,

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/9bd13a48-f776-4573-a4a3-d62d1c599106

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"

share|improve this answer
    
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. –  KHA Mar 27 '13 at 21:09
    
one in MSDN article is best one. –  Muhammad Raja Mar 27 '13 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". –  KHA Mar 27 '13 at 22:29
1  
You will need the module to deploy the custom masterpage –  Remko Nov 17 '13 at 21:23
    
and here's an example tutorial for that too :) sharepointchick.com/archive/2010/03/26/… –  Muhammad Raja Nov 18 '13 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.

share|improve this answer
    
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. –  KHA Mar 29 '13 at 9:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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