My.ADVISOR.com Sign-In
ID
Password

Member Center / Sign-Up
   
SUBSCRIPTION STATUS
If you are a subscriber to this publication, sign-in to access locked articles. To subscribe or renew go to www.AdvisorStore.com.
Go to Article
Advanced Search 

SHAREPOINT DEVELOPMENT

SharePoint Customization: Site Definitions vs. Site Templates

One of the biggest challenges in customizing your SharePoint site is deciding whether the customization must happen at the site definition or site template level. Learn the strengths and weaknesses of each approach so you can make the right decision for your environment.

By Robert Bogue, ThorProjects consultant

SharePoint technologies offer two key ways to create a "rubber stamp" from which you can create sites. The site definition approach is a hard-core method that involves editing ASPX pages, modifying XML, and generally looking behind the covers. The site template approach is easier, and just requires the use of the Web interface and occasionally Microsoft FrontPage. However, the site template approach doesn't support every kind of change and requires you to be particularly careful not to unghost pages in the site. Site definitions open the entire array of options for change to you, but they're substantially more difficult to create. The choice between these two approaches largely depends on your situation.

In this article, I walk you through the strengths and weaknesses of each approach and expose the criteria you can use to make an educated decision about which one is right for you.

Site templates

Site templates in their most basic form are easy to create. You simply configure a site the way you want it and save that site to a template (STP) file from the site administration pages (Site Settings > Site Administration > Save site as template). The sheer ease of creating a site template makes it ideal for low-effort customization. If you want a few more lists than the standard site definition creates, simply create a site template.

Site templates offer these advantages:

No server touch -- Site templates don't require access to the server. Site definitions by contrast require file system access to the SharePoint server, and the ability to reboot Microsoft Internet Information Services (IIS) for your development server.

Easy to create -- Site templates are easy to create from the site administration menus. You can customize the site using the Web user interface or Microsoft FrontPage.

Single file deployment -- Because everything you need is in the single STP file, you don't have to worry about putting the files in the correct directories or accidentally creating a conflict. Of course, the site definition on which the site template is based must be on the server.

Changes to the template after sites have been created -- Because the template is just a rubber stamp applied when you create the site and there is no further connectivity with the template, you can change the template at will. However, your changes won't be reflected in the site.

No need to coordinate with other groups -- Because there aren't any internally significant identifiers in the template file, you don't have to coordinate globally unique IDs with other groups as you do with site definitions.

There are many good reasons to customize your SharePoint site with site templates. However, there are also some challenges. The primary challenges with using site templates as your customization strategy are uhghosting and list definitions.

Unghosting

Windows SharePoint Services (WSS) is able to maintain a high level of performance because it uses pointers in the database to files located on the Web servers' file system. Pointers let you virtually include a single file on the file system in every site, thereby increasing performance. Almost anything you do to a site in FrontPage that requires you to save so the change takes effect causes WSS to make a copy of the original page and store it in the database. This process makes upgrades much more difficult and reduces performance by 15-20 percent. There are many ways around this scenario, but anytime the layout of the page has to change and you're using a site template, you'll be unghosting the page and dealing with the consequences. Unghosted pages, in addition to being slower, can't contain any server-side code and can't load controls you haven't listed in the SafeControls section of the web.config file.

List definitions

List definitions, which are part of the site definition, drive the list content, including the default fields, views, and forms. You can't use a site template to customize anything more than just the fields, default views, and lists you created. You can, however, create separate List templates that will allow you make more changes. These are not a part of the site template. They are instead a different file, with the same STP extension.

Even with the disadvantages, site templates are a compelling approach to customizing Windows SharePoint Services (WSS).

Robert Bogue, MS MVP Microsoft Office SharePoint Server, MCSE, MCSA:Security, etc., has contributed to more than 100 book projects and numerous other publishing projects. http://www.thorprojects.com/blog Rob.Bogue@thorprojects.com

Printer-friendly
page layout

What do YOU think about this topic? Share your advice and thoughts using this form.

Your Name

REQUIRED : PUBLIC

Your E-Mail

REQUIRED : PRIVATE

Job, Company

OPTIONAL : PUBLIC

City, State, Country

OPTIONAL : PUBLIC

Your Web Site

OPTIONAL : PUBLIC

Your Comment

Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

ARTICLE INFO

FREE ACCESS FREE ACCESS

Keyword Tags: Collaboration, Customization, Microsoft, Microsoft SharePoint, Microsoft SharePoint Portal Server, Microsoft Windows, Microsoft Windows SharePoint Services, Portals, Security, Site Definitions, Site Templates, XML

Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
Portions copyright ©1983-2010 Advisor Media, LLC. All Rights Reserved.
Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, LLC in the United States and/or other countries.
Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
Hosted by Prominic.NET Website powered by
LOTUS SOFTWARE
ztmssp0604 BOGUR04 posted 2006-3-13 mod 03/08/2010 03:11:10 AM ztdbms/ztdbms
domino-144.advisor.com my.advisor.com 03/13/2010 10:33:34 AM