Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Find out which Site Template was used on an existing sit

  Asked By: Jennifer Leach         Date: Oct 19, 2009      Category: Sharepoint      Views: 948
 

Is there any easy way that I find out which site template was used on a
SharePoint site when it was created? It seems no where to find this
property once the site was created.

Tagged:                      

 

2 Answers Found

 
Answer #1       Answered By: Christop Mcfadden          Answered On: Oct 19, 2009       

Look for the string

This will refer to the Template and Configuration used.

<TemplateID>1</TemplateID>
<Configuration>0</Configuration>

 
Answer #2       Answered By: Gopal Jamakhandi          Answered On: Oct 19, 2009       

The following code will show you. I'll add it to my STSADM extensions at
some point. To get the description of the site  template, look in the
WEBTEMP* files in the 12\TEMPLATE\1033\XML folder (substitute your
locale Id as necessary).

----- BEGIN CODE ------

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.SharePoint;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

if (args.Length != 1)

{

Console.WriteLine("Usage: ConsoleApplication1.exe [site_url]");

return;

}

string url = args[0];

using (SPSite site = new SPSite(url))

{

using (SPWeb web = site.OpenWeb())

{

Console.WriteLine(String.Format("Template information about
{0}", url));

Console.WriteLine(String.Format(" WebTemplate: {0}",
web.WebTemplate));

Console.WriteLine(String.Format(" WebTemplateID: {0}",
web.WebTemplateId));

}

}

}

}

}

 
Didn't find what you were looking for? Find more on Find out which Site Template was used on an existing sit Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].