ConfigLabs

April 18, 2007

SharePoint Site Template Vs Site definition

Filed under: Itfootprint, SharePoint 2007 — Jag @ 2:23 am

There is always some confusion on when to use site template or site definition. I found a nice explanation to this confusion on MSDN2.  According to the article;

“When to Use Site Definitions

Customizing portal sites and other SharePoint sites using site definitions is most appropriate for third-party developers and server administrators. Because site definitions require access to the file systems of the Web server, server administrators must always be involved in the deployment of site definitions. If you are modifying areas of a portal site, then you will need to use site definitions.

Although deploying a site definition requires more work, site definitions typically perform better when cached on the file system instead of in the database. In addition, you can achieve a finer level of customization by directly editing all the schema files and not depending on the existing site definition as a site template does. Also, if you want to introduce new file types, view styles, and drop-down edit menus, you need to edit the schema files that make up the site definition.

Custom site definitions are version and upgrade independent. Subsequent upgrades to SharePoint Products and Technologies may overwrite existing default site definitions. Using custom site definitions excludes your sites from potential upgrade issues.

However, there is no easy way to modify site definitions once they are deployed. There is always the possibility of breaking existing deployed sites derived from the site definition once you modify an existing site definition. You can only add to the site definition once it is deployed.

When to Use Site Templates

Site templates, compared to site definitions, are easy to create and deploy. You can make all customizations through the user interface or FrontPage 2003. In addition, you do not need to be a server administrator on the Web server to create and deploy site templates. You can modify a site template without affecting existing sites created by the template. Deployment is simple because template data is stored centrally in the configuration database.

Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance. Templates in the database are compiled and executed every time a page is rendered. Windows SharePoint Services does some performance optimization whereby it stores templates on the local Web server and a copy (or “ghost”) of the page in the configuration database. However, you can easily prevent Windows SharePoint Services from using a copy of the page by using Web Folders or FrontPage to open, modify, and save it. From this point forward, the database is used to render the page. Preventing Windows SharePoint Services from using a copy of a site page will cause the page to stop picking up changes from the site definition files, so if you want to keep a consistent look across the entire portal and only want to modify the site definition files, then don’t prevent this optimization. Rendering pages from the database will result in an initial performance penalty.

Site templates only work on SharePoint sites that are not portal sites (not based on the SPS templates). Furthermore, site templates are not ideally suited for a development environment. In effect, they are still customizations of a site definition. If the site definition does not exist on the server, the site template fails.

Typically, because of these issues, site templates are not as efficient as site definitions in a large-scale environment”

But you should notice that, when you create site out of site template or site definition, and make changes to either of them, will that effect the sites already created out of them? I am still having this confusion.

12 Comments »

  1. Jag;

    Congratz on the blog. Good to see you blogging. I am sure you will see the gains in blogging as I have seen.

    My company just moved to sharepoint and now I am working on a team site in sharepoint. Just made the basic stuff however, will need to work and see how it goes.

    My initial assessment is that it is not a bad tool. Let me know if you any good tools/guides for users.

    Cheers,
    Suhit

    Comment by Suhit Anantula — April 22, 2007 @ 11:03 am

  2. I see many people are reading this post. So did little search on this issue and came up with more analyses on the differences between site definition and site templates. Check the post “Site definitions Vs Site Templates – Part 2″.

    Ta
    Jag

    Comment by Jag — May 24, 2007 @ 7:32 am

  3. [...] Posts SharePoint Site Template Vs Site definitionUsing Query String and Data view WebPart.Usability Issue with SharePoint 2007An Alternate to content [...]

    Pingback by Footprint of IT Site Templates Vs Site Definitions - Part 2 « — May 24, 2007 @ 9:49 am

  4. [...] worth considering the differences between (more here). Some of the differences demystified (note – about Beta 2). Info on how to create a [...]

    Pingback by novolocus.com » Creating Site Templates — January 9, 2008 @ 3:16 pm

  5. Thanks for the post

    Comment by ABSEPOBJEMO — August 3, 2008 @ 1:07 pm

  6. Nice work on the blogs! Very relevant material mate!

    Comment by Doug — November 10, 2008 @ 9:56 am

  7. understanding large [url=http://www.favit.de/story.php?id=2915]cialis kaufen[/url] neath

    Comment by Stichetex — February 8, 2009 @ 10:14 pm

  8. Hi… To answer your question, a previously created sharepoint site will be affected if you make any changes on to the site definition file. However, this is not the case with Site Template. For example, you created a site using a custom site template, then you decided to modify the custom site template. This modification will not effect the already created site. The modification will only will only effect the new site.

    Comment by Felicia — February 10, 2009 @ 4:01 pm

  9. Furthermore, as stated in the MSDN, it is not advisable to directly modify the existing custom Site Definition as there is a possibility of you breaking the existing site. Therefore, it is better to use feature stapling if you wish to update the existing site definition.

    Comment by Felicia — February 10, 2009 @ 4:07 pm

  10. hi ,

    Really very good article. I impressed.

    Thanks

    Comment by Alankar Sooraj — June 18, 2009 @ 6:27 pm

  11. Hi

    Any one can plz share how to Generate XML file from 2 diff Databases with out useing BDC metaman

    i mean to ask how it is Possible with Active Definition File …..

    Any one Came to know abt this kindly share….

    Comment by KedarNath — September 20, 2009 @ 10:56 pm

  12. Thanks for the info but the window at right (“about jag”) is partially covering the text. Even in this text window I can’t see everything I’ve typed.

    Comment by phil — October 15, 2009 @ 2:21 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.