Dec 4, 2008

Site definition

A site definition itself does not represent a creatable site template. Instead, a site definition contains one or more configurations, and these configurations are what appear to users as creatable site templates. Therefore, the STS site definition contains three different configurations: Team Site, Blank Site, and Document Workspace.

Similar to a WSS feature, a site definition is defined with a set of Collaborative Application Markup Language (CAML)-based files that are deployed within a named directory on the file system of each front-end Web server in the farm. Site definitions are deployed within the 12\TEMPLATE\SiteTemplates directory. The core file of the site template is 12\TEMPLATE\SiteTemplates\{sitetemplate_name}\xml\onent.xml. It is referenced in the 12\TEMPLATE\{culture}\XML directory in WEBTEMP.XML files, where the folder is the locale identifier (12\TEMPLATE\1033\XML for US English).

Here is sample of the onet file, it define every thing about the site

A xml file in the 12\TEMPLATE\{culture}\XML folder can contains the configuration of more than one site templates.Here is an exmaple

When creating a new site by using the STSADM.EXE command-line utility or through custom code, you are often required to reference a site definition and one of its configurations by name. This is done by specifying the name of the site definition followed by the pound sign and the integer identifier of the configuration. For example, you can use STS#0 to reference the site template titled Team Site and STS#1 to reference the site template titled Blank Site. The following example uses one of these site template references when creating a new top-level site by using the STS command-line utility.

STSADM.EXE -o createsite -url http://Domain.com -ownerlogin Domain\Administrator -owneremail administrator@Domain.com -sitetemplate STS#1