Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
I got a lot of questions of colleages regarding custom templates and site definitions.
As stated in the help: "A custom template is a customization applied to a site definition. When a user customizes a site or list in the user interface, the custom template consists of the difference between the original state of the site or list as determined by its definition and the state of the site when the custom template is generated. Custom templates remain tied to a particular site definition (for example, the one for a SharePoint site or a Meeting Workspace site), so that if the site definition is not present or is changed, the custom template will not work."
In many cases building Portals with SharePoint Portal Server you want to change the defined Site definitions. These Site definitions are the templates you can choose from when you create a new site.
The problem with changing a Site definition is that when somebody else in another Portal creates a site with the same template, he is also getting your changes. So the following sequence of steps can be taken to create your own Site definition.
The first thing you have todo is copy an existing Site definition and rename it. Existing site definitions are found in the folder <localdrive>:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Template\<localeid>. For example copy the STS folder and rename it to MYSTS.
In this folder you will find an XML folder containing the file ONET.XML. This is the schema file containing Collaborative Application Markup Language (CAML). If you want to make changes to the listings, WebParts and other stuff showing up when creating a site, this is file to make the changes in.
The next step is telling SharePoint that there is a new template defined. Under the folder <localdrive>:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\<localid>\XML you will find a schema file called WEBTEMP.XML. Copy this file and call it WEBTEMPMY.XML. It is very important that the name of the file starts with WEBTEMP.
Your WEBTEMPMY.XML will look like this:
<?xml version="1.0" encoding="utf-8" ?><!-- _lcid="1033" _version="11.0" _dal="1" --><!-- _LocalBinding --><Templates xmlns:ows="Microsoft SharePoint"> <Template Name="MYSTS" ID="10200"> <Configuration ID="0" Hidden="False" Title="<some title>" Type="0" ImageUrl="<someimage>" Description="<somedescription>"> </Configuration> </Template></Templates>
The following things are very important:
The final step is resetting the IIS by calling iisreset. It also works when recycling the application pool used by your Portal.
Further information regarding this subject can be found in the article "Creating a Site Definition from an Existing Site Definition" in Microsoft SharePoint Products and Technologies 2003 Software Development Kit.
And finally a good article which goes further into this by Robert Bogue: