tags:

views:

54

answers:

3

during site creation using sharepoint , sharepoint offers some templates. if we need to create a site other than a template offered , how do we proceed ?

+2  A: 

You are talking about custom "site definitions" and custom "site templates". Google those terms and you'll find tons of information.

Colin
A: 

You can design your own custom templates. Install VSeWSS extension for Visual Studio and it has a project type called "Blank Site" template. You can use it as a base starting point and customize the solution generated to your needs. All the information required to do so is available in the help document that comes with VSeWSS.

Kris
+2  A: 

You have 2 options:

  1. Site Templates
  2. Site Definitions

Many people use those terms interchangeably, but there are big differences between the two.

Site Templates

Site templates are easy to create. Basically, you create a site using a ite definition (e.g. the blank site) and start customizing it. You can add lists and libraries and setup the site however you want it. Then, go to Site Actions > Site Settings > Save site as template. You can save your site as a .STP file. The .STP file basically records everything that you added or changed on your site after site creation.

Once saved, your site template will show up in your site template gallery. You can go to the site template gallery and save the .STP file offline. Your new site template will be available in the subsite creation page in the "custom" tab. The template will only be availalbe in this site collection, unless you add the .STP file to the site template gallery of another site.

You can deploy site templates globally. So, if you want everyone to see a STP in their subsite creation page, you can run the following stsadm command:

stsadm -o addtemplate -filename BoardDirectors.stp -title "Board of Directors"

You can retract site templates whenever you want without affecting the sites that used them for creation. This makes them easy to version, as long as you don't want to push updates to existing sites.

One big problem with site templates is that you cannot staple features to them.

Site Definitions

Site definitions are collections of XML files deployed to the 12 hive. They are harder to develop; you basically have to use Visual Studio. The XML files have to be packaged into a SharePoint WSP and deployed using STSADM.

Creating a site definition gives you the most control over your site. Another benefit is that sites using the site definition will always reference the site definition's files, so updates will be recognized by sites using that site definition. For example, if you find a bug, you can fix it in one spot and all sites using that site definition will be fixed.

Note that withdrawing a site definition will break sites that use it.

Recently, many SharePoint experts have recommended staying away from creation new site definitions because of the overhead. Instead, if custom functionality is needed, they recommend coding custom features and just activating those features on sites.

Think about which option you need. In our organization, we chose not to create any new site definitions, and use site templates sparingly. Custom functionality is driven primarily by the use of features.

Jim