In Windows SharePoint Services, when an end user creates a site through the user interface (UI), he or she does so by selecting one of two possible types of foundations that can define how to instantiate the site:
Either type of foundation determines, for example, the lists, files, Web Parts, Features, or settings with which to provision a new SharePoint site.
Site definitions consist primarily of multiple XML and ASPX files stored on a front-end Web server in folders under the \\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE directory.
Custom site templates are stored in the database and are created by using an existing site, with or without its specific content, as a model. This provides a means for reusing sites that you have customized.
Since custom site templates are based on existing sites, at least the first site in any Windows SharePoint Services 3.0 deployment must be founded on a particular configuration within a site definition. A custom site template adds to, but does not repeat, the structural and content information from the original site definition. Hence, custom templates are dependent on the site definitions from which they ultimately derive much of their structure. If the site definition is changed or not present, the custom template will break.
In the Windows SharePoint Services 3.0 object model, an SPCustomWebTemplate represents a custom site template. An SPWebTemplate can represent either a site definition (and configuration) or a custom site template.
In Collaborative Application Markup Language (CAML) markup, a site definition is represented by the combination of two things:
-
A <Template> element in a WebTemp*.xml file in the installation directory, usually c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LCID\XML\, where LCID is the numerical ID of the language/culture such as 1033 for English.
-
An ONET.xml file in the installation directory, usually c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\site_type\XML\, where site_type is the name of the site definition. So site_type can be "STS," "MPS," "BLOG," "WIKI," "CENTRALADMIN," or the name of a custom type of site.
But such a site definition is really a family of one or more site definition configurations, each of which is represented by one of Template element's child <Configuration> elements. Details of the configuration are stored in a corresponding <Configuration> element in the ONET.xml file.
By contrast, a custom site template is stored as a .stp file in the SharePoint database and is listed in the site templates gallery for the site. You can copy the file to a folder, change its extension to ".cab", and open it.
SharePoint Team Services 1.0 from Microsoft included only one definition for instantiating sites, the "Team Site," but Windows SharePoint Services 2.0 extended the template architecture so that multiple site definitions and templates can be used within a deployment. Windows SharePoint Services 3.0 enhances the Web development platform further by modularizing Features, making it easier to create and apply custom applications. For information about Features, see Working with Features.
In This Section
See Also