SharePoint Tip #41. Do you know “how to find the site definition being used for a site”?!
Sometimes you have a already created site but wanted to know the site definition of that site, or gets the name of the site definition from which the site template that was used to create the site is derived. There are several steps to get that template
- Navigate to the “Central Administration –> Application Management –> Site Collection List” and choose the site you are trying to find the template for
- Write down site "Title” and “Database name” values
- Open SQL management studio and execute the following query for content database that you find from previous step
1: SELECT Title, WebTemplate,ProvisionConfig
2: FROM dbo.Webs
3: WHERE Title = '<title of your site>'
- Write down the number in “Web Template” column
- Navigate to this site http://blumenthalit.net/blog/Lists/Posts/Post.aspx?ID=45 and find definition is associated with that ID
That’s all.
The second way to get it is via SharePoint API SPWeb.WebTemplate property. Sample is there
Tips & Tricks section moved to its own site. http://sharepoint.devs-sandbox.com/index.php?/Tips-and-Tricks/Development/tip-41-how-to-find-the-site-definition-being-used-for-a-site.html