Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Determine Site Template from site

  Asked By: Vanraj    Date: Dec 10    Category: Sharepoint    Views: 11410

I always had this question in mind. Is there a way to find out somehow
from a sharepoint site, as to which Site Template it has been built from?

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Talia Johns     Answered On: Dec 10

You can use a combination of the WebTemplate and Configuration properties of
the SPWeb object to find  out which template  the site  was originally built
from. The WebTemplate will contain something like "STS" which is the name
of the subdirectory in the 12 hive Template/sitetemplates directory
containing the site definition. The Configuration will correspond to the
Configuration ID inside the onet.xml in that subdirectory. However there
are a couple issues with this.



1. You must use getSubwebsForCurrentUser to get an SPWebCollection if
you want to check the templates used for subsites. Iterating through the
Webs property will report a -1 rather than the real configuration property.

2. This gives you the base site definition if the site was built  from
a site template. There is no way that I know of to get the actual site
template name, just the site definition.

 
Answer #2    Answered By: Tera Callahan     Answered On: Dec 10

But I was asking for some means from
where I can find  this without writing any code.

 
Answer #3    Answered By: Mark Davis     Answered On: Dec 10

The site  definition used when building a site isn't available anywhere in
the user interface. The only other way to get the underlying site
definition, without writing code, would be to do the following:

1. Save the site as a template

2. Download the template  to your local harddrive

3. Change the extension from .stp to .cab (the .stp is a normal
compressed cabinet file)

4. Open the .cab file and extract the manifest.xml file to your hard
drive

5. Open the manifest.xml file in an editor and find  the TemplateID and
Configuration elements. These reference a specific site definition value
listed in one of the Webtemp.xml files stored in the 12 hive at
template/1033/xml.

Personally, I find it easier to write a quick command line utility program.
Again, these values will only give you the base site definition from which
the site was built, not the site template if one was used. There is no way
that I know of to get the site template (.STP) file used to create an
existing site.

 
Answer #4    Answered By: Delilah Mcpherson     Answered On: Dec 10

you can find  the site  definition and configuration from spweb. But
since sites created from Site Templates are "unghosted", no information is
stored with sites about their parent site templates.

An easiest solution without writing code is, before saving site as a template,
edit site in designer and put your site template  name as text on home page or on
master page.

however if you are interested in displaying site definition name and
configuration id, put some inline script on your site pages.

msdn.microsoft.com/.../...oint.spweb.webtemplateid\
.aspx

 
Answer #5    Answered By: Praveen Battula     Answered On: Aug 19

This is what exactly you are looking for.
praveenbattula.blogspot.com/.../...sharepoint.html

-Praveen

 
Didn't find what you were looking for? Find more on Determine Site Template from site Or get search suggestion and latest updates.




Tagged: