Chris’s SharePoint Reflections

Just another WordPress.com weblog




  • Chris Zhong

    IT consultant Australia








Custom Site Definition

Posted by chrissyz on August 1, 2008

Try to answer some questions regarding custom site definition in my company. Thought maybe it is worth sharing here. 🙂

1 – Can we make changes in an already created site, by making some changes to the Site Definition, or will the change be applied only to sites which will be newly created thereon?

 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. The best practice is always copy from one of the existing site definitions, rename it and modify it and then add to the site definitions.  The most popular one to start with is STS (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\). I  start with BLANKINTERNET, a bit tricky, don’t recommend. Alternatively, you can start from scratch (not recommended either).

 

2 – What are the basic advantages of creating a Site Definition?

Well there are pros and cons regarding the custom site def and I think you should know both sides

Pros:

·         The biggest one will be the performance as the pages are cached on the file system instead of in the database. You might want to go over the ghosted /unghosted concept if you are not familiar with it.

·         Higher level of customization by directly editing all the schema files and not depending on the existing site definition as a site template does.

·         Activate the features (especially site columns and page layout) during the site creation

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

·         Certain kinds of customization to sites or lists require use of site definitions, such as introducing new file types, defining view styles, or modifying the Edit menu.

Cons:

·         Relative complex process, require access to the file system of the front-end Web Server (need to get an admin involved for deployment)

·         User cannot apply a SharePoint theme through a site definition

·         Editing a site definition after deployment is difficult

 

3 – How maintainable and flexible a site definition is from the perspective of making any changes to it, if required in future.

 

A combination of site definition and features is the best approach although MOSS versioning is still a pain.

 

4 – How can we make changes to the site definition? Feature Stapling is one option I have heard of.

 

Yes, when you want to activate a feature on a site definition that is already in production, or to add it to a OOTB site definition, you need to use feature stapling.  It is bad practice (and not supported) to change the site definition after it is being used in production.  Therefore, the feature stapling is a good option to go.

 

5 – Do we have any document on best practices that we can follow while creating a Site Definition?

There is a good article on MSDN regarding working with Site Templates and Site Definition. Worth to have a look.

http://msdn.microsoft.com/en-us/library/ms434313.aspx

 

 

Advertisements

One Response to “Custom Site Definition”

  1. Dennis said

    Thanks for sharing. Especially the overview of pros & cons of site definition is very handy!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: