Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Create a site collection by specifying a custom template name inst

  Asked By: Sampat    Date: Mar 31    Category: Sharepoint    Views: 1844

We are exploring creating new site collections through the SharePoint
object model and also through the SharePoint web services. So far we
have found you can specify the template ID associated with a custom
template installed in the Virtual Server Gallery using the SharePoint
object model. For example, one of our custom templates has an
auto-assigned ID of "_GLOBAL_#0". This ID was assigned when
installing the template using the STSADM utility. We are able to
successfully create a site collection programatically using a custom
template ID. However, is it possible to specify the custom template
name rather than it's ID? In the case where we have multiple web
front-ends for SharePoint, a custom template must be installed on each
front-end, so that they are available to users regardless of what
front-end they access. This poses a problem later because the
auto-assigned template ID's are often different on each front-end.
This makes it tricky to create site collections programatically based
off a custom template ID.

Is it possible to specify the template name (string name) in the
SharePoint object model or using the SharePoint web services? Maybe
there is another approach?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Kareem Flynn     Answered On: Mar 31

You can't create  a site  collection directly using the name of the
template. However, you could retrieve the collection  of templates  from
a WFE server  and then look in the collection for a template  with a name.
Once you have the template you can then get the template ID from that
collection object.

 




Tagged: