How to: Create a Custom Site Definition and Configuration

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

You can create a custom site definition by copying an existing site definition and then modifying the copy. In the modification stage you will change some Collaborative Application Markup Language Core Schemas markup in two schema files: one that is a copy of a WebTemp.xml file, and the other a copy of an Onet.xml file.

Warning

You must not modify the originally installed WebTemp.xml file.

  1. Copy an existing site definition folder located in the Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\ directory. Your copy should be a peer of the original and you can give it any name that contains no spaces.

    For example, to create a custom site definition that derives from the team site definition for Windows SharePoint Services, copy the \sts folder.

  2. Make a copy of the WebTemp.xml file that is located in Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML.

    Give the file a unique name by appending a string to the name of the original file; for example, WebTempAction.xml. At run time, the compiler merges information contained in this file with the information contained in the original file to specify which site definition configurations are available for creating new sites.

  3. Customize the contents of the new WebTemp file.

    Each WebTemp.xml file contains a collection of Template elements and Configuration subelements, which identify to the compiler all the site definition configurations that can be instantiated. The Configuration element defines, for example, a title, a description, the URL for the image displayed in the user interface (UI), and a display category that specifies the tab on which to display the template in the Template Selection section of the New SharePoint Site page.

    Important

    In each Template element defined in the WebTemp file, the Name attribute must contain the same name that is assigned to the new folder. Also, to avoid conflict with IDs already used in Windows SharePoint Services, use unique values greater than 10,000 for the ID attribute.

Example

The following example defines a single site definition. The example assumes the existence of an \ActionCommittee folder that has been created as previously described.

<?xml version="1.0" encoding="utf-8" ?>
<Templates xmlns:ows="Microsoft SharePoint">
  <Template Name=" ActionCommittee " ID="10001">
    <Configuration ID="0" Title="Action Committee Team Site" 
      Hidden="FALSE" ImageUrl="images/stsprev.jpg"
      Description="This template provides a forum for the team 
      to create, organize, and share information quickly and easily. 
      It includes a Document Library, and basic lists such as 
      Announcements, Events, Contacts, and Quick Links." 
      DisplayCategory="Collaboration">
    </Configuration>
  </Template>
</Templates>

You may need to reset Internet Information Services (IIS) to cause the new definition configuration to appear as an option in the UI. To do this, enter iisreset at a command prompt.

See Also

Tasks

How to: Use Site Definition Configurations

Concepts

Working with Site Templates and Definitions