Programmatically add a site template (.stp) to SharePoint
The way to do this with a function would be using a File Element . STP files live in /_catalogs/wt
, so this type of function will load the file.
Update: More details in Create a function to load a site template file (.stp) into MOSS , but elements are presented here for completeness. XML:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="TeamSiteTemplate" List="111" Url="_catalogs/wt">
<File Url="TeamSiteTemplate.stp" Type="GhostableInLibrary">
<Property Name="LanguageDisplay" Value="English" />
<Property Name="Version" Value="3" />
</File>
</Module>
</Elements>
source to share
It looks like there is a simple batch file for this, calling the STSADM tool with the -AddTemplate parameter. Command:
stsadm -o addtemplate -filename c:\template.stp -title "Template Title" -description "Template Description"
You can also delete an existing template using the command:
stsadm -o deletetemplate -title "Template title"
See the article for details .
source to share
to be more precise: "stsadm -o addtemplate" adds a site template to the central template gallery "not to a specific MOSS team site, ie in the gallery family template "; I think this could be a significant difference in some (large) environment where it might be appropriate to narrow the available template to a sitecollection.
Installing Application Templates for Windows SharePoint Services 3.0
source to share