Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Getting Webpart Templates

  Asked By: Haresh    Date: Aug 04    Category: Sharepoint    Views: 803

Wanted to know if there is any method available to get the list of All
Site definitions( for eg team site is STS#0, Blank Site is STS#1 and so
on)

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Edgardo Atkins     Answered On: Aug 04

The Administrator guide lists all the OOTB ones:

The value must be in the form name#configuration. If you do not specify the
configuration, configuration 0 is the default (for example, STS#0). The list  of
available templates  can be customized to include templates you create.

Values available in a default installation include:

STS#0 (Team Site)

STS#1 (Blank Site)

STS#2 (Document Workspace)

MPS#0 (Basic Meeting Workspace)

MPS#1 (Blank Meeting Workspace)

MPS#2 (Decision Meeting Workspace)

MPS#3 (Social Meeting Workspace)

MPS#4 (Multipage Meeting Workspace)

Note If you added a template to the central template gallery, you must specify
the template name as _GLOBAL_#number, where number refers to the template ID.

 
Answer #2    Answered By: Kamal Mayachari     Answered On: Aug 04

Dim web As spWeb
web = SPControl.GetContextWeb(System.Web.HttpContext.Current)
Dim site  As New spSite(web.Site.Url.ToString)
Dim spWebTemplates As SPWebTemplateCollection =
spSite.GetWebTemplates(System.Convert.ToUInt32 (web.Locale.LCID))

This will give you all the site definitions/templates available on the
top level site.
The web.Locale.LCID is the LCID of the site.

 
Didn't find what you were looking for? Find more on Getting Webpart Templates Or get search suggestion and latest updates.




Tagged: