Question

WSP for Site Definition does not show up when creating a new site. I uploaded a new wsp under the solution gallery of the site collection. I went to a sub site and click on Create from "all content" and I dont see the site def (wsp) that I uploaded and activated in the solution gallery.

Was it helpful?

Solution

In addition to your site template (onet.xml), you need either to add webtemp*.xml file or to include WebTemplate element in your solution.

WebTemplate element (recommended)

WebTemplate elements are added starting from SharePoint 2010. You can use features to add them to your portal, and this is the only approach which is avaliable for sandboxed solutions. Farm solutions can use WebTemplate elements too, of course.

Awesome article from Stefan Stanev about this:

WebTemp*.xml

Farm solutions can use webtemp*.xml files for the same purpose. Actually, it is an old way to provision information for your web template (inherited from SharePoint 2007), so I don't recommend you to use it.

This file should be placed to {14 hive}\TEMPLATE\{LCID}\XML\ folder, where {LCID} is your locale ID, for example, 1033.

This could be achieved with SharePoint Mapped Folder.

File should contain XML code, for example:

<Template Name="ContosoBase" ID="10001">
    <Configuration ID="0" Title="Contoso Basic Site" Hidden="FALSE"
ImageUrl="/_layouts/images/contosoprev.png" Description="This template provides a standard site configuration
for basic Contoso sites." DisplayCategory="Collaboration"> 
    </Configuration>
</Template>

Additional MSDN articles:

OTHER TIPS

Site definitions can not be deployed as sandboxed solutions. You must use a farm solution. If you built your wsp in Visual Studio, you need to change the Sandboxed Solution property of your project to False.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top