Site Definitions Vs. Site Templates
Hello All, When should one favor Site Definitions over Site Templates and Vice versa ?
May 15th, 2009 8:33am

Moving to GeneralWSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 8:37am

Sachin, these link should help you Deciding Between Custom Templates and Definitions http://msdn.microsoft.com/en-us/library/aa979683.aspx Guidelines for Using Custom Site Definitions, Configurations, and Templates http://msdn.microsoft.com/en-us/library/ms416071.aspxMCTS - MOSS 2007 Configuring, .NET 2.0 | SharePoint Architect | Evangelist | http://ramakrishnaraja.blogspot.com/
May 15th, 2009 8:56am

This is really a common source of confusion among sharepint developers. The fact that site definitions are located in a folder named SiteTemplates compounds the confusion. Before going into direct comparison, let me define both:Site Templates : Are snapshots of sites at a point in time. When a user customizes a site from the UI or SPD, the custom template consists of the difference between the original state of the site (determined by its definition) and the state of the site or list when the custom template is generated.Custom templates remain tied to a particular site definition (for example, the site definition for SharePoint Web sites or Meeting Workspace Web sites), so that if the site definition is not present or is changed, the custom template cannot work.Site Definitions : As the name implies, A Site definition is "core definition of a site" . Each site definition emerges through a combination of files that are placed in the 12 hive of WFE during installation of SharePoint. Site definition files include .xml, .aspx, .ascx, and .master page files, as well as document template files (.dot, .htm, and so on), and content files (.gif, .doc, and so on).Now to the fun part, the comparison :) Site Definitions Site Templates Files areon disk, better performance. Files arein database, less efficient. Highly customizable and extensible (XML and .NET code is much more flexible than UI) Not easily extensible (You are limited by what UI offers) Can provision multiple webs * Can only provision one web Complex to create Easier to create Requires admin access to server for deploying. Installable from a Web UI by site owners. Modifying the site definition after provisioning at least one site from it is not supported and might break existing sites. Custom templates can be modified without affecting existing sites that have been created from the templates(**). * This could be achieved using Provisioning handler ( For more info, refer to the Publishing Site Definition in the 12 hive )** Please note that If the site definition on which the custom template is based does not exist on the WFE, the custom template does not work. On the surface, it appears that a site template has numerous advantages; it is certainly easier to create and deploy, and you can change it without breaking sites that use earlier versions of the template because it is not centralized in the 12 hive. However, the fact that a site template contains everything about a site in a single file makes granular modifications of individual elements very difficult. For many projects, that is a good enough reason to suffer the additional complexity of site definitions. However, site definitions present a different challenge. If you change an existing site definition in the 12 hive, you run the risk of breaking any sites that were created previously and use the existing definition. ( Besides, this is not supported by Microsoft ) , The key is to adopt the same strategy as for the core WSS site definitions: Keep the definition as simple as possible and use feature stapling for everything else. Feature stapling allows you to add a feature to an already existing site definition. You may think this would be a complete waste of time, because you can simply add the feature into the site definition using far less code than having a feature staple, but when I tell you that Microsoft does not support modifying a site definition in any way after a single site has been provisioned from that site template, you may reconsider. Features are not an alternative to site definitions. Features are a complement to site definitions. If you keep the site definition as simple as possible and use features for the majority of a site elements, you gain the benefits of granular control in the development environment while reducing the risks involved in making changes to production systems over the life of the sites. Ayman M. El-Hattab, Microsoft Certified SharePoint Specialist, http://ayman-elhattab.blogspot.com .. Follow me at twitter @ http://twitter.com/aymanelhattab
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 9:46am

This is really the best explanation and comparison I have ever seen for a subject that really confused me . Thanks Ayman
May 15th, 2009 9:57am

Wonderful
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 9:59am

You are welcome :)Ayman M. El-Hattab, Microsoft Certified SharePoint Specialist, http://ayman-elhattab.blogspot.com .. Follow me at twitter @ http://twitter.com/aymanelhattab
May 15th, 2009 10:01am

Ayman, what do you mean by Provisioning handler?
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 10:17am

Jacob, check this URL : http://www.sharepointbriefing.com/spcode/article.php/3792601.SPWebProvisioningProvider class is extremely HELPFUL .Ayman M. El-Hattab, Microsoft Certified SharePoint Specialist, http://ayman-elhattab.blogspot.com .. Follow me at twitter @ http://twitter.com/aymanelhattab
May 15th, 2009 10:21am

In case you are wondering why I unmarked this. Ayman already has a post marked as an Answer in this thread. This answer is just complementary information to that long post. The thread is also already marked as answered. (Moderator)WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 10:30am

aha . This means that we should use Site Definitions in case we need high level of granular modifications ! Nice tips
May 15th, 2009 11:37am

nice comparison indeed
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 12:32pm

Thanks all for your nice commentsAyman M. El-Hattab, Microsoft Certified SharePoint Specialist, http://ayman-elhattab.blogspot.com .. Follow me at twitter @ http://twitter.com/aymanelhattab
May 15th, 2009 12:38pm

Site Definition is defined as custom solution as It can be created from zero. and Site template can only created from Site Defination. So that we can understand thatSite Definition is base structure and Site Template is structure create on base of Site Definition.
Free Windows Admin Tool Kit Click here and download it now
May 16th, 2009 4:26am

Brilliant explanation, thanks for clearing this up!!
April 14th, 2012 11:48am

Nice explanation really.Swati Soneji
Free Windows Admin Tool Kit Click here and download it now
June 6th, 2012 3:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics