views:

232

answers:

1

Hello all,

iam new to sharepoint my requirement is, we are developing a business intelligence dash board using pps with some custom reports built on it.

I need to replicate this site to create n no of subites based on this bi dash board site. So iam planning to make this site as a site template and trying to create the site programmatically based on this site template. Can anyone help me how to achieve this.

Waiting for your reply.

A: 

One of the overload of creating a site accepts a site template object. What you need to do is to retrieve this object iterating through the collection of the custom web templates of the site collection: SPSite.GetCustomWebTemplates. You just get the one you need by name

Vladi Gubler
Hi Gubler,Your solutions seems to be the apt thing for me as i am new to this sharepoint stuff can you eloborate me with more detail exploation with some real time example.
Sharan Raj
SPSite site = SPContext.Current.Site;var templates = site.GetCustomWebTemplates(1033); //change 1033 to your languageforeach(var template in templates){if(template.Title="template name"){SPContext.Current.Web.Webs.Add("url", "title", "description", 1033, template, false, false);//change 1033 to your language}}
Vladi Gubler