I'd like to give future site "administrators" the ability to create collaboration subsites (based very loosely on the team site definition) beneath a parent site simply by adding an item to a list.

Consider the following parent site's list/doclib:

Title (single line of text) | DatabaseID (number) | Logo (File)

Upon adding an item to this list, a subsite should be created based on the definition -- each subsite will be largely the same, with a few exceptions/concerns:

a) The list structure is the same across sites, but the contents of the lists will be populated after the site has been created, based on the DatabaseID entered into the parent list. I believe I have a decent handle on how to accomplish this via Server Object Model and the repository pattern.

b) The site logo (instead of the team site photo of "people collaborating") should be the one that is uploaded to the parent site's list. I don't know how to accomplish this.

c) The subsite lists will contain lookup columns to managed metadata (or site columns) from the parent site. (will this just work?)

Is all of this possible? Does the approach make sense? What SharePoint customization techniques should I be looking at to accomplish this? So far I am considering the following:

  • Create the parent list and deploy an Event Receiver that will handle the ItemAdding event.
  • Create the subsite in that event, based on a Site Definition (or Web Template?) What is the best way to create such a site definition? Build a generic subsite first using Designer/web UI tools, then "save it" and tweak it with Visual Studio? Build it entirely using Visual Studio?

How can I improve/augment this plan to accomplish my goal and alleviate the above concerns? Thank you in advance for any insight you can provide on this topic.

1 Answer 1


b) you can get a reference to the attached file from the list item

c) Create content types and deploy them to the hub, or the containing site collection

I would suggest a timer job instead of an event receiver. The provisioning of a site can be quite lengthy, and you run the risk of blocking the web server process while that happens. Add a column to thelist indicating if the site was created so the timer job can determine which items on which to act.

Web template is the preferred approach. But, as long as your custom functionality is in features, it really doesn't matter.

  • Thanks! I checked out some of what you mentioned and I appreciate the direction. For c) I was able to get the child->parent lookup working by setting up a Site Column in the parent and referencing it in the child list. Is this approach no good? I will read up more on content types. Also -- would switching the event receiver to handling the itemadded event (asynchronously) be roughly the same as a timer? Finally -- with the Web template approach, I cannot staple features but I shouldn't need to because features like custom web parts can be packaged right into the template, correct?
    – mikey
    Jul 11, 2012 at 5:20

Your Answer

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

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