Create site-collection based on custom sandbox solution template

SharePoint provides a couple out-of-the-box web templates. When implementing SharePoint this you probably want to provide a customized template which suit the needs. A big advantage would be if you are not depending on an administrator and being able to provide your own custom template. With sandboxed solution in SharePoint 2010 this is possible! What is really nice about this, you can also do this when creating a site-collection and choose the custom template for the root web.

I created a site-collection based on the out-of-the-box Team Site template (STS#1). Made changes to the site by adding a new list FAQs, added a task to the Task list and added the Tasks list on the homepage. This is the basics for my template.

Template - Team Site

Next step is to save the team site as a template.

  1. Click Site Actions » Site Settings
  2. Click Save site as template
  3. Fill in the fields
    • File name: TeamSiteTemplate
    • Template name: Team Site Template
    • Check the Include Content checkbox
  4. Click OK
  5. Click the link Solution Gallery in the “Operation Completed Successfully” window
  6. Click the “TeamSiteTemplate” name to download the WSP solution file, save on your desktop

At this point we have a WSP solution file containing a template for a new site. We want to create a new site-collection based on this template. But we do not want to upload the WSP solution as a Farm Solution. We can create the new site-collection based a sandbox solution containing the template.

  1. Open SharePoint 2010 Central Administration via Start Menu
  2. Click Application Management » Create Site Collections
  3. Select a web application
  4. Fill in the fields
  5. When selecting a template, click the Custom tab and select “< Select template later… >”
  6. Click OK

The site-collection is created but has no template. Meaning it is also not provisioned with lists and libraries. We want the site-collection to be based on our sandboxed solution template. Next steps will explain!

  1. Open the new site-collection URL
  2. The “Template Selection” page is shown
    Template - Template Selection
  3. Click Solution Gallery
  4. Upload the sandboxed solution by click the Solutions tab in the ribbon
  5. When uploaded, activate the solution by clicking Activate in the Solution Gallery – Activate Solution window
  6. Go back to the Template Selection page (_layouts/templatepick.aspx) by using the Back-button
  7. Refresh the page, the Custom tab should show up
    Template - Template Selection 2
  8. Select the Custom tab and select our “TeamSiteTemplate”
  9. Click OK

Now the site-collection is provisioned based on the sandboxed solution. The site is provisioned with the FAQs list and one task in the Task list which is shown on the homepage.

Template - Complete