| By Kris Syverstad | Article Rating: |
|
| February 9, 2005 12:00 AM EST | Reads: |
54,640 |
Microsoft Windows SharePoint Services and Microsoft Office SharePoint Portal Server provide a lot of functionality out of the box. After installation you can begin creating portal and team sites. These newly minted sites can be customized; content can be created and managed, color themes can be modified, and pages for the site can be edited. All of this is great, however many attempts to create a portal within an organization fail because little or no consideration is given to user acceptance. The most important reason for creating a custom site definition is to address user acceptance issues. Identifying a problem domain and designing a site definition that addresses specific issues within that domain will greatly increase the likely success of your portal.
Even though you could edit the files that have been distributed with SharePoint to meet these requirements, you shouldn't. Files that are part of the SharePoint installation are vulnerable to change through upgrades and patches. By creating a custom site definition you are isolating yourself from some, but not all, upgrade issues. Another approach to customizing SharePoint is to use the SharePoint user interface to modify the structure of your site and FrontPage to edit the look and feel. This approach is good when you are looking for a quick and easy solution. Custom site definitions are best suited for problems that require a more rigorous development model.
This article will describe the basic process for creating custom site definitions and will explore some best practices. We are going to build a site definition that could be used as a template for project management sites. Before creating a custom site definition, you should figure out what site definition within SharePoint most resembles your needs. Custom Site Definitions are not typically written from the ground up; it is much easier to start with a working example and add/remove/update functionality in small amounts until you get all of your requirements implemented. The Team Site (STS) site definition seems like the most common starting point and the one we will use as our baseline.
Getting Started
To get started with creating a site definition, follow these steps:
1. Copy the entire directory for the site definition that you are using as a baseline. For this example we will use the STS site definition.
drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\STS
2. Rename the new directory. For this example we will use PROJMAN.
drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\PROJMAN
3. Create a WebTemp XML file for the new site definition. Copy the existing WEBTEMP.XML.
drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\XML\WEBTEMP.XML
4. Rename the new file WEBTEMP. [folder_name].xml. Replace folder_name with the name of the folder that you created in step two. For this example we will use WEBTEMP.projman.xml. You don't have to use the dot notation, nor do you have to include the folder name.
drive:\Program Files\Common Files\Microsoft Shared\web server
extensions\60\TEMPLATE\1033\XML\WEBTEMP.projman.xml
5. Edit the WEBTEMP file in order to specify unique values for the template Name and ID attributes. For this example we have used PROJMAN and 10791 respectively for these values. (Microsoft recommends a value larger than 10,000 to avoid conflicts).
<Template Name="PROJMAN" ID="10791">
<Configuration ID="0" Title="Project Management Site" Hidden="FALSE"
ImageUrl="/_layouts/images/stsprev.png" Description="This template provides a standard site configuration
for project management sites."> </Configuration>
</Template>
WEBTEMP files are XML configuration files that SharePoint aggregates in order to determine what site definitions are available for use. For example, all of the SharePoint Portal templates are located in the WEBTEMPSPS.XML file. Moreover, the WEBTEMP file can be used to create additional configurations that are available for use within the site definition. For this example we will just use the default configuration.
To enable SharePoint to detect the new site definition you will need to restart IIS. To test the new site definition use the create site page.
Once you verify that the site definition works, it would be wise to get these files checked into a configuration management tool. From this point on we are going to be editing files that can be difficult to debug if problems occur, so it is good idea to make small changes, test them by creating a new site, and check in significant improvements.
Build Script
The more changes you make to a site definition between creating an instance of a site, the more difficult debugging will become. Using a script for deleting/editing a site is much faster than using the SharePoint user interface, and since you can create a script that will destroy the site if it exists before creating a new site, your development environment won't get polluted with test sites.
UI Changes
Now that we have a working site definition it's time to start on the customization. All SharePoint pages are ASP.NET pages, so editing them is pretty much the same as editing any other ASP.NET page; the only exception is that you don't have the code behind page readily available. You can make quite a few UI changes with standard HTML/ASP.NET modifications. For this example we have rearranged the content and navigation sections of the page. Don't be afraid to get creative with this, you can truly make some fantastic looking SharePoint sites.
CAML is an XML language that SharePoint uses to describe data structures for lists as well as for the presentation of data. Although CAML is XML and should be treated as such, it is not parsed as XML by SharePoint. This can cause problems if your XML isn't well structured. It is more than likely SharePoint will just ignore broken elements and you won't receive an error message. It's a good idea to open your CAML documents using a tool like Internet Explorer, Visual Studio, or FrontPage that will validate the structure and provide an interface for expanding and collapsing the document. Internet Explorer is an ideal tool to use to become familiar with CAML because it allows you to expand and collapse the elements and doesn't let you change the file.
Published February 9, 2005 Reads 54,640
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kris Syverstad
Kris Syverstad is a Microsoft Most Valuable Professional (MVP) for SharePoint Portal Server and a member of the Microsoft Collaboration &
Portals Developer Advisory Council. He leads the Rocky Mountain SharePoint
Users Group, and has been invited to present on SharePoint Best Practices to Microsoft Product Teams and at Microsoft's Architectural Summit.
![]() |
shirley 11/04/08 01:03:31 AM EST | |||
We can assist here as we specialize in developing and implementing SharePoint – that’s all we do. There is more information on this at http://www.nsynergy.com/Services/Pages/default.aspx or mail to Mark.Davis@nsynergy.com |
||||
![]() |
Gery D. Dorazio 03/22/05 07:08:02 PM EST | |||
Kris, |
||||
![]() |
Amrita 02/21/05 01:09:36 AM EST | |||
Perfect,real nice explanation. |
||||
- Kindle 2 vs Nook
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Computing & Federal IT - What Does the Future Hold?
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Cloud Expo and the End of Tech Recession
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Eval JavaScript in a Global Context
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications



































