Go With The Flow...
Following on from my previous post where I described how to define a minimal master page for Windows SharePoint Services (WSS), I thought it would be very useful to create a site definition with this master page already applied.
There's are several articles which show how to build your own site definition including the following:
- Building Master Pages for Windows SharePoint Services 3.0 using Site Definitions in Visual Studio 2005
- How to: Create a Custom Site Definition and Configuration
- How to: Use Site Definition Configurations
The first thing to do was to create a new WEBTEMP.XML file for my site definition. Each front-end Web server in a deployment of WSS has a WEBTEMP.XML file located in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\1033\XML\ folder. This file contains all the default site definitions that ship with WSS (such as "Document Workspace", "Basic Meeting Workspace", "Team Site" etc) and should not be modified. Instead, I created a copy and renamed it WEBTEMPMINIMAL.XML, then stripped out all the original site definitions, and created my new "Minimal Document Workspace" definition as shown.
Note the <Template Name="Minimal"> attribute - this is used to later when creating the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\Minimal\ folder that contains my specific configurations.
Once WEBTEMPMINIMAL.XML was deployed to the WSS server, I performed an IISReset and the new site definition appeared in the list of site templates as "Minimal Document Workspace".
Next I had to create a new ONET.XML file, which determines what the site definition actually looks like, what lists are created, what document templates are available, what the top and side navigation areas appear on the home page etc.
Copying the ONET.XML for the out of the box "Document Workspace" definition, I stripped out all the features I didn't need, leaving me with a site definition with just a single document library, and saved it to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\Minimal\XML\ folder.
Finally, I wanted to to modify the behaviour of the default.aspx page that is provided with the out of the box "Document Workspace" definition. I decided that I wanted to provide two different default pages for any site created using my new site definition.
Firstly I created a default.aspx page that used the default master page in order to create a normal WSS site experience with all the standard navigation "chrome". As you can see, when I navigate to http://server/sites/demo/test/default.aspx I get the standard SharePoint look and feel.
Then I created a minimal.aspx page that used my custom master page to create the minimal WSS site with no navigation "chrome". As you can see, when I navigate to http://server/sites/demo/test/minimal.aspx I get the view that I can easily embed in a CRM IFRAME.
Although, it looks fairly straightforward, I went through a fairly lengthy trial & error process to get this to work just as I wanted. I have uploaded a copy of my site definition here, along with a batch file which copies the different files to the correct location on the WSS server and performs an IISReset. Once you have copied the files, you should see the new "Minimal Document Workspace" in your list of available templates when you go and create a new site.
This posting is provided "AS IS" with no warranties, and confers no rights.