5.4. Creating a Publishing Site Definition

A SharePoint site definition consists of a tree of CAML elements that describe the different parts of the site and how they relate to one another. The topmost element is the template element. It is declared in a special file called WEBTEMP, which contains one or more template Configuration elements that reference associated site definition Configuration elements declared within the ONET.XML file associated with the site definition. Figure 5-4 shows how these files are related.

Figure 5-4. Figure 5-4

When thinking about site definitions and how they are used, it is important to understand the difference between template Configuration elements and site definition Configuration elements. When users create a new SharePoint site or site collection through the user interface, they are given the opportunity to select from the available site templates. What they are seeing onscreen are the visible template Configuration elements as specified in the WEBTEMP.[ name].XML file, where [name] is the template name. The site definition Configuration elements are contained within the ONET.XML file that describes the actual components of the site.

5.4.1. The Significance of Site Definitions

This terminology can be a bit confusing. Sometimes site definitions are incorrectly called site templates and vice versa. While both terms refer to the general capability ...

Get Professional SharePoint® 2007 Web Content Management Development: Building Publishing Sites with Office SharePoint Server 2007 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.