Reading Time: 3 minutes

Introduction

The architecture of site definitions of sharepoint 2003 is completely different from MOSS 2007 Site Definition due to introduction of Site Features.

Site Definition and Site Template are Similar.

Site Template is easy to create and deploy.

But

  1. Site Definition allows more Customization.
  2. Once installed we can use any web application.
  3. We can applied at site collection creation as the template for the top-level site.
  4. Don’t break as easily, since the site definitions (if you follow best practices) don’t key on other site definitions that might change with Service / Feature Pack installations.
  5. Require extensive knowledge of CAML  Query

Site Definitions are located in the following folder on the SharePoint server:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATESiteTemplates

Site Definitions are a complex and large topic that we will not develop into in an in depth manner right now. The purpose of this document is to describe how to create a simple custom Site Definition in order to set the stage for the other documentation.

Creating a Simple custom Site Definition in MOSS 2007

The following tasks are all you need to do to create a custom Site Definition in MOSS 2007.

Step 1: Copy an existing Site Definition.

Step 2: Create the WEBTEMP XML fragment file to register the Site Definition with SharePoint.

Step 3: Reset IIS

Step 4: Create a site based on the custom Site Definition.

Step 1: Copy an existing Site Definition.

 

Navigate to the following directory on the SharePoint server in Windows Explorer:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATESiteTemplates

Copy the STS directory and paste it back into the same directory.

Rename the Copy of STS directory to CustomSTSSD

Navigate to the following directory on the SharePoint server in Windows Explorer:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATE1033

Copy the STS directory and paste it back into the same directory.

Rename the Copy of STS directory to CustomSTSSD

Step 2: Create the WEBTEMP XML fragment file to register the Site Definition with SharePoint.

 

Create a file called WEBTEMPCustomSTSSD.XML in the following directory:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATE1033XML

Put the following XML into the WEBTEMPCustomSTSSD.XML file:

<?xml version=”1.0″ encoding=”utf-8″ ?>

<!– _lcid=”1033″ _version=”12.0.4017″ _dal=”1″ –>

<!– _LocalBinding –>

<Templates xmlns:ows=”Microsoft SharePoint”>

<Template Name=”CustomSTSSD” ID=”10001″>

<Configuration ID=”0″ Title=”CustomSTSSD Site” Hidden=”FALSE” ImageUrl=”/_layouts/images/stsprev.png” Description=”This sample template creates a site for teams to create, organize, and share information quickly and easily. It includes a Document Library, and basic lists such as Announcements, Calendar, Contacts, and Quick Links.” DisplayCategory=”Custom Site Definitions” > </Configuration>

<Configuration ID=”1″ Title=”CustomSTSSD Blank Site” Hidden=”FALSE” ImageUrl=”/_layouts/images/stsprev.png” Description=”This sample template creates a Windows SharePoint Services-enabled Web site with a blank home page. You can use a Windows SharePoint Services-compatible Web page editor to add interactive lists or any other Windows SharePoint Services features.” DisplayCategory=”Custom Site Definitions” > </Configuration>

<Configuration ID=”2″ Title=”CustomSTSSD Document Workspace” Hidden=”FALSE” ImageUrl=”/_layouts/images/dwsprev.png” Description=”This sample template creates a site for colleagues to work together on documents. It provides a document library for storing the primary document and supporting files, a Task list for assigning to-do items, and a Links list for resources related to the document.” DisplayCategory=”Custom Site Definitions” > </Configuration>

</Template>

</Templates>

 

*Note: The DisplayCategory attribute of the <Configuration> element dictates which tab the configuration will appear on in the Template Selection section of the create site web page. You can create your own tabs by putting your own values in this attribute (like we have done here).

Save the file.

Step 3: Reset IIS

Open a command prompt on the SharePoint server.

Type in the command: iisreset

Wait for IIS to reset

Step 4: Create a site based on the custom Site Definition.

 

Open Internet Explorer

Navigate to the Sites Directory in your SharePoint portal (Ex : http://pc000264:18562/sites/GIS_Dev/default.aspx)

Click the Site Actions –> Create Site Link

Fill out the information on the form.

Notice at the bottom of the page in the Template Selection section the new Custom Site Definitions tab.

Click this tab and select one of the available configurations.

Click the Create button to Create a New Custom Site using your Site Definition.

 

Communities Tagged : Technology
Tagged: SiteDefinition

One Response to “Creating a Simple Custom Site Definition in MOSS 2007”

  1. Dama, Satish Says:

    Nice and Useful

Published by NS, Jenkins on 07 Jan 2009 at 12:46 pm