0

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

2 Answers 2

1

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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