Share via


How to find the template name of SharePoint site?

 

Sometimes if the SharePoint site is too customized it becomes hard to get the info abut the template used for it.

Here is a sample code and steps which would help us to get the info about the template used.

<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<script runat="server">
protected override void OnLoad(EventArgs e){
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPWeb thisWeb = this.Web)
{
lblWebTempalte.Text = thisWeb.WebTemplate;
lblWebTemplateID.Text = thisWeb.WebTemplateId.ToString();
}
});
}
</script>
<asp:Content ID="Main" runat="server" contentplaceholderid="PlaceHolderMain" >
<p>
Web Template: <asp:Label ID="lblWebTempalte" runat="server" />
</p>
Web Template ID: <asp:Label ID="lblWebTemplateID" runat="server" />
</asp:Content>
<asp:Content ID="PageTitle" runat="server" contentplaceholderid="PlaceHolderPageTitle" >
Site Template Information
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" runat="server" contentplaceholderid="PlaceHolderPageTitleInTitleArea" >
Site Template Information
</asp:Content>

 

  • Save the code snippet code as .aspx page ( eg:webtemplate.aspx) to your layouts folder (usually C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS)
  • Once the page is saved you can access it from any of your SharePoint sites via https://servername/_layouts/webtemplate.aspx
  • Compare the web template ID with the below List of MOSS 2007 Template ID Information

1 - STS - "windows SharePoint Services Site", "Team Site", "Blank Site", "Document Workspace"
2 - MPS - "Basic Meeting Workspace", "Blank Meeting Workspace", "Decision Meeting Workspace", "Social Meeting Workspace", "Multipage Meeting Workspace"
3 - CENTRALADMIN - "Central Admin Site"
4 - WIKI - "Wiki Site"
7 - BDR - "Document Center"
9 - BLOG - "Blog"
20 - SPS (OBSOLETE) - "SharePoint Portal Server Site"
21 - SPSPERS - "SharePoint Portal Server Personal Space"
22 - SPSMSITE - "Personalization Site"
30 - SPSTOC (OBSOLETE) - "Contents area Template"
31 - SPSTOPIC (OBSOLETE) - "Topic area template"
32 - SPSNEWS (OBSOLETE) - "News area template"
33 - SPSNHOME (SubWebOnly) - "News Home template"
34 - SPSSITES - "Site Directory area template"
36 - SPSCOMMU (OBSOLETE) - "Community area template"
38 - SPSREPORTCENTER - "Report Center Site"
39 - CMSPUBLISHING (SetupPath=SiteTemplates\PUBLISHING) - "Publishing and Team Collaboration Site"
40 - OSRV (SetupPath=SiteTemplates\OSRV) - "Shared Services Administration Site"
47 - SPSPORTAL - "Corporate Intranet Site"
50 - SRCHCEN - "Search Center"
51 - PROFILES - "Profiles"
52 - BLANKINTERNETCONTAINER - "Internet Presence Web Site"
53 - BLANKINTERNET - "Publishing Site", "Press Releases Site", "Publishing Site"
54 - SPSMSITEHOST - "My Site Host"
90 - SRCHCENTERLITE (SetupPath=SiteTemplates\SRCHCENTERLITE) - "Search Center Lite"
6221 - PWA (SetupPath=SiteTemplates\PWA) - "Project Web Access Site"
6215 - PWS (SetupPath=SiteTemplates\PWS) - "Project Workspace"
14483 - OFFILE - "Records Repository", "Records Repository"