« Understanding the RESX Resource Files | Main | SiteSpider »

June 01, 2008

Site Definitions - Customisation Part I : Cloning

There are various ways that you can customise a SharePoint site, some easier than others. I think that before you take the first steps to customising your environment, you need to consider what your final deliverable is going to be. There seems to be some disagreement on whether site definitions or Features is the way to go. I don’t profess to know the answer to that one but it does seem to depend on what you are trying to do.

 

For this post I will look at cloning an existing site definition, the Team Site. We won’t be modifying the definition at this time (we’ll save that for a future post). Your cloned site definition will appear as a new entry on the Collaboration tab.

 

First things first…

 

Cloning the “Team Site” site definition

The first thing we need to know is where the site definitions are actually stored. To confuse things, Microsoft called the directory SiteTemplates and you can find it here;

 

          C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates

 

Within the SiteTemplates directory are multiple sub-directories. Which ones you see will depend on whether you have Windows SharePoint Services 3.0 (WSS3.0) or Microsoft Office SharePoint Server 2007 (MOSS) installed. The image below shows the MOSS installed site definitions

 SiteTemplatesDirectory

Figure 1 – The SiteTemplates Directory

 

The next thing you will notice is that there isn’t a directory called “Team Site”. The definition is held within the STS directory, so this is the first place we need to look. The directory structure for STS is as follows;

 STSDirectory

Figure 2 – The STS Directory

 

Within the xml directory is a file called ONET.XML. We’ll come back to ONET.XML later on.

So, the first thing we need to do is take a copy of the STS directory and then rename the copy. In this example I have called my new site definition CUSTOMSTS. We will need this name later on.

 CUSTOMSTSDirectory

Figure 3 – The CUSTOMSTS Directory

 

You should now see your CUSTOMSTS directory within SiteTemplates. Leave this as it is for the time being.

 

The next step is to make sure that our custom site definition appears in the Collaboration tab on the site creation page. There are a series of XML pages that tell SharePoint what site definition to display and on what tab. For these files we need to look at another directory, which you can find here;

 

          C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML

 

Within the 1033\XML directory are several XML files, as shown below

 1033XMLDirectory

Figure 4 – The 1033\XML Directory

 

The keen-eyed among you may spot a pattern in the naming convention used here. The majority of the files begin with WEBTEMP. The second part of the file name will correspond to the name of one of the sub-directories within SiteTemplates, so;

 

          WEBTEMPSPS.XML --> SiteTemplates\SPS

          WEBTEMPOSRV.XML --> SiteTemplates\OSRV

          WEBTEMPOFFILE.XML --> SiteTemplates\OFFILE

 

There are a couple of XML files here that you do not need to worry about at this time;

 

          DEADWEB.XML

          RGNLSTNG.XML

 

These XML files are used for administrative purposes and shouldn’t be touched.

 

So, where is WEBTEMPSTS.XML? Good question! For some reason, Microsoft decided to bundle multiple site configurations together into WEBTEMP.XML and WEBTEMPSPS.XML.

 

The following table provides a bit more detail on what is where.

 

XML File

SiteTemplates Directory

Site Creation Page Tab

Template Name # Configuration ID

Tab

ID

Hidden

WEBTEMP.XML

 

Global template

GLOBAL

 

0

Yes

WEBTEMP.XML

\STS

Team Site

STS#0

Collaboration

1

No

WEBTEMP.XML

\STS

Blank Site

STS#1

Collaboration

1

No

WEBTEMP.XML

\STS

Document Workspace

STS#2

Collaboration

1

No

WEBTEMP.XML

\CENTRALADMIN

Central Admin Site

CENTRALADMIN

 

3

Yes

WEBTEMP.XML

\MPS

Basic Meeting Workspace

MPS#0

Meetings

2

No

WEBTEMP.XML

\MPS

Blank Meeting Workspace

MPS#1

Meetings

2

No

WEBTEMP.XML

\MPS

Decision Meeting Workspace

MPS#2

Meetings

2

No

WEBTEMP.XML

\MPS

Social Meeting Workspace

MPS#3

Meetings

2

No

WEBTEMP.XML

\MPS

Multipage Meeting Workspace

MPS#4

Meetings

2

No

WEBTEMP.XML

\Wiki

Wiki

WIKI

Collaboration

4

No

WEBTEMP.XML

\Blog

Blog

BLOG

Collaboration

9

No

WEBTEMPBDR.EN-US.XML

\BDR

Document Centre

BDR

Enterprise

7

No

WEBTEMPOFFILE.XML

\OFFILE

Records Centre

OFFILE#0

Enterprise

14483

Yes

WEBTEMPOFFILE.XML

\OFFILE

Records Centre

OFFILE#1

Enterprise

14483

No

WEBTEMPOSRV.XML

\OSRV

Shared Services Administration Site

OSRV#0

 

40

Yes

WEBTEMPSPS.XML

\SPS

SharePoint Portal Server Site

SPS#0

 

20

Yes

WEBTEMPSPS.XML

\SPSPERS

SharePoint Portal Server Personal Space

SPSPERS#0

 

21

Yes

WEBTEMPSPS.XML

\SPSMSITE

Personalisation Site

SPSMSITE#0

Enterprise

22

Yes

WEBTEMPSPS.XML

\SPSTOC

Contents Area Template

SPSTOC#0

 

30

Yes

WEBTEMPSPS.XML

\SPSTOPIC

Topic Area Template

SPSTOPIC#0

 

31

Yes

WEBTEMPSPS.XML

\SPSNEWS

News Site

SPSNEWS#0

 

32

Yes

WEBTEMPSPS.XML

\PUBLISHING

Publishing Site

CMSPUBLISHING#0

Publishing

39

No

WEBTEMPSPS.XML

\BLANKINTERNET

Publishing Site

BLANKINTERNET#0

Publishing

53

Yes

WEBTEMPSPS.XML

\BLANKINTERNET

Press Release Site

BLANKINTERNET#1

Publishing

53

Yes

WEBTEMPSPS.XML

\BLANKINTERNET

Publishing Site with Workflow

BLANKINTERNET#2

Publishing

53

No

WEBTEMPSPS.XML

 

Minimal

MINIMAL#0

Minimal

99

No

WEBTEMPSPS.XML

\SPSNHOME

News Site

SPSNHOME#0

Publishing

33

No

WEBTEMPSPS.XML

\SPSSITES

Site Directory

SPSSITES#0

Enterprise

34

No

WEBTEMPSPS.XML

 

Community Area Template

SPSCOMMU#0

 

36

Yes

WEBTEMPSPS.XML

\SPSREPORTCENTER

Report Centre

SPSREPORTCENTRE#0

Enterprise

38

No

WEBTEMPSPS.XML

 

Collaboration Portal

SPSPORTAL#0

Publishing

47

No

WEBTEMPSPS.XML

\SRCHCEN

Search Centre with Tabs

SRCHCEN#0

Enterprise

50

No

WEBTEMPSPS.XML

\PROFILES

Profiles

PROFILES#0

 

51

Yes

WEBTEMPSPS.XML

 

Publishing Portal

BLANKINTERNETCONTAINER#0

Publishing

52

No

WEBTEMPSPS.XML

\SPSMSITEHOST

My Site Host

SPSMSITEHOST#0

Enterprise

54

No

WEBTEMPSRCH.XML

\SRCHCENTERLITE

Search Centre

SRCHCENTERLITE#0

Enterprise

90

No

 

As you can see, there are quite a few entries that the user doesn’t actually see.

 

Following on with the WEBTEMP naming convention, we need to copy WEBTEMP.XML and rename it to WEBTEMPCUSTOMSTS.XML. Open the new file and remove everything except the following code;

 

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

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

<!-- _LocalBinding -->

<Templates xmlns:ows="Microsoft SharePoint">

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

  <Configuration ID="0" Title="My Team Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png"

Description="My Team Site – based on the original STS team site."

DisplayCategory="Collaboration" />

</Template>

</Templates>

 

You can see that I have changed the Template Name to CUSTOMSTS to match the directory we created in SiteTemplates. Title has changed to My Team Site and I have amended the Description field. Save your amendments.

 

We now have a new directory and a new XML file. At this point we will just have a copy of the “Team Site” site definition.

 

To get SharePoint to pick up our new changes we will need to reset IIS, so open a command prompt window and enter IISRESET.

 

Now go back to SharePoint and create a new site – under the Collaboration tab you can see your new site definition, as shown below.

 CreateNewSite_MyTeamSite

Figure 5 – The Site Creation Page

 

You will now be able to create a new site based on the My Team Site definition, although it won’t look any different to a normal Team Site. In the next post we’ll apply a custom master template to the site definition.

 

As always, your comments on my posts are welcome.

 

Until next time…

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e55208b9ed883400e552ae63cc8834

Listed below are links to weblogs that reference Site Definitions - Customisation Part I : Cloning:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment