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:
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">