Site Definitions and Configurations

Applies to: SharePoint Foundation 2010

A site definition defines a unique type of Microsoft SharePoint Foundation website. Several site definitions are built into SharePoint Foundation. A site definition can include more than one site definition configuration. A SharePoint Foundation website is based on particular site definition configuration. For this reason, you can think of a site definition as a family of configurations, although some families contain only one configuration.

The following are the four site definitions whose configurations can be used to create new websites.

  • STS includes the site definition configurations for, Blank Site, Team Site, and Document Workspace.

  • MPS includes the site definition configurations for Basic Meeting Workspace, Blank Meeting Workspace, Decision Meeting Workspace, Social Meeting Workspace, and Multipage Meeting Workspace.

  • BLOG provides a site definition configuration for blogs.

  • SGS provides a site definition configuration for Group Work Site.

The following site definitions are also built into SharePoint Foundation, but they cannot be used as the basis for new sites.

  • CENTRALADMIN provides a site definition configuration for central administration websites.

  • TENANTADMIN provides a site definition configuration to support SharePoint Foundation site hosting features.

  • WIKI provides a site definition configuration for legacy wiki sites that were originally created in an earlier version of SharePoint Foundation. Because standard site pages on SGS sites are wiki-enabled pages, users do not have to create sites that are specifically for wikis.

  • GLOBAL provides a basic configuration used for initializing all other site configurations.

Each site definition consists of a combination of files that are placed in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates subfolders of SharePoint Foundation servers during installation of SharePoint Foundation. The XML markup in the site definition files may include references to files in other subfolders of %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE, including .xml, .aspx, .ascx, and .master page files, in addition to document template files (.dot, .htm, and so on), and content files (.gif, .doc, and so on).

Page Customization

Site definition files are cached in memory on the server when first accessed at run time, which improves scalability and performance by reducing unnecessary data storage or retrieval, and by allowing uncustomized pages to be reused across sites. The information contained in these files is pulled from the cache for each subsequent request.

When site pages are customized, excluding browser-based customizations such as modifications to Web Parts, the pages and their contents are stored in the content database. Uploaded .aspx files are also stored in the database. The contents of customized pages are routed through safe mode parsing, which prevents unsafe server-side code from executing, and which depends entirely on the Safe Controls list—specified in the web.config file of the SharePoint Foundation application's subfolder in C:\Inetpub\wwwroot\wss\VirtualDirectories—to determine which controls can be rendered at run time.

Core Schema Files

The following are the prominent XML files that govern the structure and content of a site definition.

  • WebTemp*.xml Files

    Identify the site definitions and configurations and provide information about how they appear in the user interface (UI) to users who are creating new websites.

    Location: %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\1033\XML

  • Onet.xml Files

    Define the navigation areas, specify the list definitions available in the UI, specify document templates and their files, define the base types for lists, and define configurations and modules for site definitions.

    Location: %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteDefinitions\site_type\XML

Each of these XML files uses Collaborative Application Markup Language (CAML) to define various aspects of a site.

The built-in WebTemp.xml file, and any supplemental WebTemp*.xml files that may have been deployed, specify which site definition configurations are available for creating sites. If you are creating a custom site definition, do not edit the original WebTemp.xml file. Instead, create a custom WebTemp*.xml file as described in How to: Create a Custom Site Definition and Configuration. SharePoint Foundation merges the contents of all WebTemp*.xml files when showing available site definition configurations in the UI. This simplifies installing and uninstalling site definitions, because their contents do not have to be merged into one WebTemp.xml file.

Onet.xml defines the top navigation and Quick Launch areas, specifies a basic set of list types that are available for creation, specifies document templates and their file types, and itemizes the files and "all user" Web Parts that are available for use in site configurations. The global Onet.xml file, from which all other Onet.xml files inherit, defines the base types for lists, which include Generic List, Document Library, Discussion Forum, Vote or Survey, and Issues List.

In addition, Onet.xml uses Configuration elements to define the site definition configurations in a site definition (such as STS and BLOG) and Module elements to define the modules in each site definition configuration. For more information about modules, see How to: Provision a File.

A Configuration specifies the set of lists, Features, and modules that are included when a site is created. For more information about site definition configurations, see How to: Create a Custom Site Definition and Configuration.

For more information about the schema files used in the definition and configuration of site types, see Understanding WebTemp*.xml Files and Understanding Onet.xml Files.

Warning

Modifying an originally installed site definition is not supported. If you need a new kind of site, you must create a new WebTemp*.xml file and a new Onet.xml file, although you can create many sections of a custom Onet.xml file by copying the corresponding section from the Onet.xml file from one of the built-in site types. (But we recommend that you create custom web templates in preference to custom site definitions whenever it is possible. For more information about making the decision, see Deciding Between Custom Web Templates and Custom Site Definitions.)

See Also

Tasks

How to: Create a Custom Site Definition and Configuration

Reference

Configuration

Major CAML Files

Module

Concepts

How to: Create a Custom List Definition

How to: Provision a File

Understanding Onet.xml Files

Understanding WebTemp*.xml Files

Other Resources

Collaborative Application Markup Language (CAML)