I know, my titles suck =)

This post deals with creating a site definition that includes a couple of subsites by default; in essence we are creating our own "Collaboration Portal" similar to the default one you have at your disposal under the "Publishing" tab in MOSS 2007.

When we create a "Collaboration Portal" the following subsites are automatically created with it:

  • Document Centre
  • Report Centre
  • Search Centre
  • Site Directory
  • News

This is great, but not neccessarily what the client wants, which is why we want to be able to create out own.

So, lets start of with some basic requirements:

  • It needs to be "publishing" enabled.
  • It needs to have a document centre to store all related documents.
  • It needs to have a site directory that can be used to create and locate team sites.
  • I am only demonstrating these as you can go on and on and on.

Create your site definitions

Obviously we need to let MOSS know what sites we need, so create your site templates. For the purpose of this article I will be using the default SPSSITES and BDR site definitions that can be found in the "SiteTemplates" directory.

I have also created a "SPSDIVISIONAL" site definition that has the following site features enabled:

  • Publishing
  • SharePoint Standard Features

Create a "Site Provisioning Data File"

This is easy.

Here we are telling MOSS what the default site is for out custom divisional portal should be and what subsites should be created in it.

  1. Go to 12/Template/XML
  2. Open notepad and paste the following text:

    <!-- DEFAULT CRAP -->
    <?xml version="1.0" encoding="utf-8"?>
    <portal xmlns="PortalTemplate.xsd">

    <!-- YOUR CUSTOM PORTAL CRAP -->
    <web name="Home"

    <!-- IMPORTANT THIS IS THE NAME OF THE SITE DEFINITION YOU WANT TO USE AS THE ROOT SITE -->
    siteDefinition="SPSDISCOVERY#0"
    (this #0 points to the configuration that should be loaded!)

    <!-- LEAVE AS IS OR CHANGE TO CUSTOM TITLE AND DESCRIPTION -->
    displayName="$Resources:cmscore,IPPT_Portal_Root_DisplayName;" 
    description="$Resources:cmscore,IPPT_Portal_Root_Description;">

    <!-- THIS INFORMATION RELATES TO YOUR SUBSITES -->
    <webs>      
              
    <!-- THIS IS THE DEFAULT SITE DIRECTORY -->
    <web name="Teams" siteDefinition="SPSSITES" displayName="Team Sites" description="" />

    <!-- THIS IS THE DEFAULT DOCUMENT CENTRE -->
    <web name="Docs" siteDefinition="BDR" displayName="Divisional Documents" description="" />
                
            </webs>
        </web>
    </portal>
  3. Save the file as "MyCustomPortal.xml"

Create a "Container"

The purpose of this is to help MOSS understand that we want to create a "holding" area for our custom site collection.

What happens here is that we are telling MOSS that when a user selects this option from the site creation page, to actually check out our site provisioning file (MyCustomPortal) we created earlier for instructions on what sites to create as the default site, and what subsites to create.

  1. Go to the Templates/1033/XML folder and open the "webtempsps.xml" file in your favorite editor.
  2. Add the following code just before the </Templates> tag:
    <Template Name="MYCONTAINER" ID="4002">
    <Configuration ID="0" Title="MY CUSTOM SITE COLLECTION" Type="0" Hidden="FALSE" Description="Whatever" DisplayCategory="MY CUSTOM PORTALS"
    ProvisionAssembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"  
    ProvisionClass="Microsoft.SharePoint.Publishing.PortalProvisioningProvider"  
    ProvisionData="XML\\MyCusomtPortal.xml">
    (This tells MOSS where to find the config info for the sites that need to be created)
    </Configuration>

    Note that this is not an actual site definition, rather it is telling MOSS where the info for creating the sites is
  3. Dont forget to add in the reference to your own custom site definition that you want to use as the root site (if you have not done so already)

Done

IISRESET, create new site collection.

Short and sweet!