Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am making a custom site definition an I want my users to be able to set two extra properties when they select the site template. Currently I see the normal options "Title" & "URL Name". I think the answer needs to go in template found in webtemp*.xml file but I don't know how.

For others looking to learn site definitions here is a good tutorial: http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/11/11/sharepoint-2010-cookbook-how-to-create-a-custom-site-definition-with-additional-content-in-sharepoint-2010-using-visual-studio-2010.aspx

share|improve this question
add comment

2 Answers 2

You will not be able to do that. Even if you could get those properties into the definition, how would you propose to consume them?

You have two options for storing these properties: the site's property bag, or a list. I'd recommend a list since it's easier to work with. If you need to run code or enable certain features based on what the site owner enters, you can attach an event handler on that list.

If you absolutely must have this data before the site is created, you will have to write a custom site provisioning application.

share|improve this answer
add comment

I don't think you can do it through the webtemp*.xml file. The way I've done this before is to ask them for the information AFTER the site is created.

One way I have done this is to create a webpart that is on the homepage by default that asks the user's to fill something out or do something and then when that is complete and saved the webpart removes itself from the page.

Or the other way was to write an HTTPModule that checks to see if the site being access meets a certain criteria, and if so, redirect to a custom application page (_layouts) that asks the user to fill in some information.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.