• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

Sharepoint template galley

I have wrote event handler for site creation ,user will raise site request , concern person will approve the request ,once request is approved site get created .

For these process i used team site template sts01...but my requirement is when user is creating  request by creating Item in List that time he should able to select site template from list field , in list field sharepoint all site template should get populated to select so when approver is approving the request site will create by that particular template  

can someone hepl me or guide me .Thanks.
  • 4
1 Solution
Another alternative is to use a workflow to achieve, what I'm understanding to be, an interface to select a site template.
Coding an event handler could be a solution if you didn't have the requirement to prompt the user for an action.  
sandipkhardeAuthor Commented:
thing is that when request is coming to approval that time aprover should able to project template site as per project ?

can you pls  collaborat how can i do this things with workflow or eventhandler?
sandipkhardeAuthor Commented:
Hi ,

I managed by following code, only thing is when i am adding anu custom template  i have to add that template title in choice field of list.

//Create a Subsite
                            string ParentUrl = properties.ListItem.Web.Url;
                            SPSite ositecollection = new SPSite(ParentUrl);
                            SPWeb mysite = ositecollection.OpenWeb();

                            string siteTitle = properties.ListItem.Title;
                            string siteUrl = ParentUrl + "/" + siteTitle;
                            string siteDescription = "Test";
                            string sitetemplate = sTemplate + ".stp";
                            SPWeb newWeb = mysite.Webs.Add(siteTitle, siteTitle, siteDescription, 1033, sitetemplate, true, false);
                            newWeb.AllowUnsafeUpdates = true;

Open in new window

sandipkhardeAuthor Commented:
second thing when you are uploading custom template that custome template should be with .stp extn,
sandipkhardeAuthor Commented:
second thing when you are uploading custom template that custom template should be with .stp extn,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now