Wednesday, May 22, 2013

How to find the template name of SharePoint site?

General Questions:

I have SharePoint site which is fully customized I would like to know the template name of site, because the SharePoint is created by some body else I don't know which template the guy had selected (like team site, blank site, publishing, collaboration site etc. while creating the site.

Answer

  • Code Snippet
    <%@ 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>

    Please follow the steps to know the template name of sharepoint site:
    • 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 http://servername/_layouts/webtemplate.aspx
    • Compare the web template ID with the below List of MOSS 2007 Template ID Information

    List of MOSS 2007 Template ID Information
    0 - GLOBAL (SetupPath=global) - "Global template"
    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"

    For more information please visit
    http://blog.rafelo.com/2008/05/determining-site-template-used-on.html
    http://www.frontpages-web-hosting.net/forums/microsoft-office-sharepoint-server-2007-moss-2007-development-topics/486-moss-2007-template-id-information.html

Reference
http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/721bec39-2d32-4bbc-9094-a021a0d06dcb


No comments:

Post a Comment