The following properties of SPWeb could be used to determine the site template(definition):
- WebTemplate - the name of the site definition or site template
that was used to create the site
- WebTemplateId - the identifier (ID) of the site definition that
was used to create the site
- Configuration - the identifier (ID) of the site definition
configuration that was used to create the site, or the ID of the site
definition configuration from which the site template used to create
the site was derived
Example
The following method is used to determine if site is Team Site:
private static bool IsTeamSite(SPWeb web)
{
return (web.WebTemplate.Equals("STS",StringComparison.InvariantCultureIgnoreCase) && web.WebTemplateId == 1 && web.Configuration == 0);
}