Deploy Custom List templates(.stp) as Feature-based Solution in SharePoint

Requirement: Had a custom List template, and wanted to make it available in create page of all sites of the site collection.

Solution:  How to deploy a SharePoint list template? Create a WSP builder solution to deploy the .stp file to the List template gallery of required site collections! Just create a Feature with the below element.xml file. Add the .Stp file to the solution.

Here is Elements.xml file:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
<Module Name="EnrollmentTemplate" List="114" Url="_catalogs/lt" RootWebOnly="TRUE">
	<File Url="Enrollment.stp" Type="GhostableInLibrary">
	  <Property Name="LanguageDisplay" Value="English" />
	  <Property Name="Version" Value="3" />
	</File>
</Module>
</Elements>

Project Structure:

SharePoint 2007 Project to Deploy List Templates (.stp)

Same way, Custom Site templates also packed. Just change the line in element.xml as:

<Module Name="EnrollmentSiteTemplate" List="116" Url="_catalogs/wt" RootWebOnly="TRUE">

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *