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 - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

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