Sunday, June 29, 2008


A site definition in Sharepoint consists of two parts:

  • WEBTEMP.xml: This is a collection of templates which are defined by ONET.xml files. The rule here is that as long as the xml files in this folder begins with the 'webtemp', then Sharepoint is gonna see that as a web template.
  • ONET.xml: Contains the bulk of the actual site definition

Here is a copy of the WEBTEMP.xml file located in 12\TEMPLATE\1033\XML:

<?xml version="1.0" encoding="utf-8"?>

<!-- _lcid="1033" _version="12.0.4518" _dal="1" -->

<!-- _LocalBinding -->

<Templates xmlns:ows="Microsoft SharePoint">

<Template Name="GLOBAL" SetupPath="global" ID="0">

<Configuration ID="0" Title="Global template" Hidden="TRUE" ImageUrl="" Description="This template is used for initializing a new site." > </Configuration>


<Template Name="STS" ID="1">

<Configuration ID="0" Title="Team Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="A site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions." DisplayCategory="Collaboration" > </Configuration>

<Configuration ID="1" Title="Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/blankprev.png" Description="A blank site for you to customize based on your requirements." DisplayCategory="Collaboration" AllowGlobalFeatureAssociations="False" > </Configuration>

<Configuration ID="2" Title="Document Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/dwsprev.png" Description="A site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document." DisplayCategory="Collaboration" > </Configuration>


<Template Name="MPS" ID="2">

<Configuration ID="0" Title="Basic Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/mwsprev.png" Description="A site to plan, organize, and capture the results of a meeting. It provides lists for managing the agenda, meeting attendees, and documents." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="1" Title="Blank Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/blankmwsprev.png" Description="A blank meeting site for you to customize based on your requirements." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="2" Title="Decision Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/decisionmwsprev.png" Description="A site for meetings that track status or make decisions. It provides lists for creating tasks, storing documents, and recording decisions." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="3" Title="Social Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/socialmwsprev.png" Description="A site to plan social occasions. It provides lists for tracking attendees, providing directions, and storing pictures of the event." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="4" Title="Multipage Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/multipagemwsprev.png" Description="A site to plan, organize, and capture the results of a meeting. It provides lists for managing the agenda and meeting attendees in addition to two blank pages for you to customize based on your requirements." DisplayCategory="Meetings" > </Configuration>


<Template Name="CENTRALADMIN" ID="3">

<Configuration ID="0" Title="Central Admin Site" Hidden="TRUE" ImageUrl="" Description="A site for central administration. It provides Web pages and links for application and operations management." > </Configuration>


<Template Name="WIKI" ID="4">

<Configuration ID="0" Title="Wiki Site" Hidden="FALSE" ImageUrl="/_layouts/images/wikiprev.png" Description="A site for a community to brainstorm and share ideas. It provides Web pages that can be quickly edited to record information and then linked together through keywords" DisplayCategory="Collaboration" > </Configuration>


<Template Name="BLOG" ID="9">

<Configuration ID="0" Title="Blog" Hidden="FALSE" ImageUrl="/_layouts/images/blogprev.png" Description="A site for a person or team to post ideas, observations, and expertise that site visitors can comment on." DisplayCategory="Collaboration" > </Configuration>



  • If you want to create your own custom site definition, you need to create a WEBTEMP.xml of your own and rename it to something like WEBTEMPCustom.xml
  • In the above WEBTEMP.xml, the top level template is GLOBAL and it is hidden. Even though it is hidden, it still needs to be listed in the WEBTEMP.xml

Elements of WEBTEMP.xml

  • Template Name
    • The Template Name identifies the site definitions directory. For example, the template name = "STS" corresponds to the directory: 12\TEMPLATE\SiteTemplates\sts
    • There is no global folder in the 12\TEMPLATE\SiteTemplates, instead the Global Site Definition is located at 12\TEMPLATE\Global.
  • Configuration ID
    • Allows a base site defintion to support multiple configurations
  • ProvisionAssembly, Class, Data
    • Conceptual equivalent of Feature receiver
    • Used by MOSS to provision portals containing multiple webs
blog comments powered by Disqus