Comments
bruce.armstrong wrote: Somebody just said it better than I did, and with more chops to say it: Open Letter to Mark Zuckerberg, Sheryl Sandberg & Facebook Mobile
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..

2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
In many cases, the end of the year gives you time to step back and take stock of the last 12 months. This is when many of us take a hard look at what worked and what did not, complete performance reviews, and formulate plans for the coming year. For me, it is all of those things plus a time when I u...
SYS-CON.TV
Creating Custom Site Definitions in Microsoft Windows SharePoint Services
Basic Process and Best Practices

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.

About 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.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

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

Kris,
Your article is the most concise I have found without the fluff. It covers the same information found in most other lengthy articles but adds a few insightful tips such as the inhibiting of FP to edit the pages...nice. One thing I have not been able to find, and would really appreciate your comments about, is a best practices approach (or any approach for that matter) for ways to also make the WSS administration and shared pages look like the new site template. There are about 130 files in that shared templates folder and it appears once a user gets onto a site and clicks a list view for instance, they are stuck with the SP layout...except for using the AlternateHeader. Any insights would be very much appreciated.
Thanks,
Gery

Perfect,real nice explanation.


Your Feedback
shirley wrote: 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 wrote: Kris, Your article is the most concise I have found without the fluff. It covers the same information found in most other lengthy articles but adds a few insightful tips such as the inhibiting of FP to edit the pages...nice. One thing I have not been able to find, and would really appreciate your comments about, is a best practices approach (or any approach for that matter) for ways to also make the WSS administration and shared pages look like the new site template. There are about 130 files in that shared templates folder and it appears once a user gets onto a site and clicks a list view for instance, they are stuck with the SP layout...except for using the AlternateHeader. Any insights would be very much appreciated. Thanks, Gery
Amrita wrote: Perfect,real nice explanation.
SOA World Latest Stories
The move to cloud-based applications has undeniably delivered tremendous benefits. However, the associated distribution creates various challenges from the quality perspective: End-to-end tests need to pass through multiple dependent systems, which are commonly unavailable, evolving,...
In this CTO Power Panel at the 10th International Cloud Expo, moderated by Cloud Expo Conference Chair Jeremy Geelan, industry-leading CTOs & VPs of Technology will discuss such topics as: Which do you think is the most important cloud computing standard still to tackle? Who should...
In this CEO Power Panel at the 10th International Cloud Expo, moderated by Cloud Expo Conference Chair Jeremy Geelan, leading executives in the Cloud Computing and Big Data space will be discussing such topics as: Is it just wishful thinking to depict the Cloud as more than just a te...
For many of the same reasons that Software-as-a-Service is catching on with enterprise buyers, delivering web services on top of Infrastructure-as-a-Service architectures is appealing to the SaaS developers. Operational agility, lower CapEx, and a broad array of tools and services are ...
According to a 2011 survey by the Independent Oracle User Group, over 50% of Oracle’s customers have deployed or are considering deploying private clouds. Most private clouds today support non-production workloads because enterprises are unable to deploy mission-critical applications i...
Facebook sold off again Tuesday scrapping the bottom at $30.98 after Reuters reported that Scott Devitt, a research analyst at the IPO’s lead underwriter Morgan Stanley, unexpectedly cut his revenue estimates on the company during the roadshow leading up to it going public last Friday....
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE