Home > SharePoint, webtemplate > How to find the template of the SharePoint site

How to find the template of the SharePoint site


How to determine what template was used to create a site pro grammatically??

Yes there is a way to find the template used to create a SharePoint site

using (SPSite site = new SPSite("http://{yoursite}"))
{
using (SPWeb web = site.OpenWeb())
{
Console.WriteLine("Template Name: {0}", web.WebTemplate);
}
}

Following is list of web template names for some commonly used templates

STS – “windows SharePoint Services Site”, “Team Site”, “Blank Site”, “Document Workspace”
MPS – “Basic Meeting Workspace”, “Blank Meeting Workspace”, “Decision Meeting Workspace”, “Social Meeting Workspace”, “Multipage Meeting Workspace”
CENTRALADMIN – “Central Admin Site”
WIKI – “Wiki Site”
BDR – “Document Center”
BLOG – “Blog”
SPSREPORTCENTER – “Report Center Site”
CMSPUBLISHING (SetupPath=SiteTemplates\PUBLISHING) – “Publishing and Team Collaboration Site”
OSRV (SetupPath=SiteTemplates\OSRV) – “Shared Services Administration Site”
SRCHCEN – “Search Center”

Note:
When you create a custom site template by saving a site as a template and then create a new site from that template, the WebTemplate property contains the name of the site definition from which the custom template derives, not the name of the custom template. Thus if the site that was used to create a custom template was itself created from the standard team site definition, the WebTemplate property of all sites that are created from the new template will return “STS”

Advertisements
Categories: SharePoint, webtemplate
  1. No comments yet.
  1. No trackbacks yet.

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: