Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a List template (a stp-file). If I upload it to the list gallery through the UI, it is uploaded and I can create lists based on that template file in the same site.

However, if I bundle it in a module in my project, and try to upload it, the file is added to the gallery, but I can't create lists with the definition! Not through UI, and not programmatically.

I use this method to upload the file to the list template gallery.

My Elements.xml is as follows:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Url="_catalogs/lt" Name="ListTemplates" Path="ListTemplates">
        <File Url="MyList.stp" Path="MyList.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
            <Property Name="Title" Value="MyList" />
            <Property Name="Language" Value="1033" />
            <Property Name="FeatureID" Value="{3A71B642-D88C-48A4-BEB7-FC8DD4EFF9FE}" />
        </File>
    </Module>
</Elements>

Update: I want to add that I created a new list template based on a new custom list, and tried to deploy it the same way, but it didn't work either. So it's not the template file that's corrupt, it's something with the method

share|improve this question
    
Is the locale for your site something other than English (US)? –  James Love Mar 14 '11 at 18:44
    
Nope, it's english. When I upload it through the UI, it also takes the language value of 1033. –  tarjeieo Mar 15 '11 at 7:04
    
I want to add that I created a new list template based on a new custom list, and tried to deploy it the same way, but it didn't work either. So it's not the template file that's corrupt, it's something with the method. –  tarjeieo Mar 15 '11 at 7:20
1  
Is the site template the same between the origin site and the one where you are deploying? A template created in a team site won't work in a non-team site, for example. –  Renan Nov 25 '13 at 22:56

3 Answers 3

Please view this Add a module named as stp (Or whatever you want). The module should look like as follows:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="stp" Url="_catalogs/lt" Path="">
    <File Path="stp\DesignLibrary.stp" Url="DesignLibrary.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists ="TRUE" >
      <Property Name="Title" Value="DesignLibrary" />
      <Property Name="Language" Value="1033" />
      <Property Name="Version" Value="4" />
    </File>
</Module>

In my view no need to use because List template itself set feature id. If you add the above property, It will add your stp in List template but you will not be able to use as template while creating list/library using this template. It will not be available in creation webpart. Link

share|improve this answer

Try like this. Have a look at this for more details.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Url="_catalogs/lt" Name="ListTemplates">
        <File Url="MyList.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
            <Property Name="Title" Value="MyList" />
            <Property Name="Language" Value="1033" />
            <Property Name="FeatureID" Value="{3A71B642-D88C-48A4-BEB7-FC8DD4EFF9FE}" />
        </File>
    </Module> 
</Elements>
share|improve this answer
    
Doesn't work. I need the Path="ListTemplates" in the Module, or else I can't activate with error message ""MyList.stp" not found" –  tarjeieo Mar 15 '11 at 7:03

Have your tried adding the name of the module in front of your Path attribute in the File tag?

Like so:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Url="_catalogs/lt" Name="ListTemplates" Path="ListTemplates">
        <File Url="MyList.stp" Path="ListTemplates\MyList.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
            <Property Name="Title" Value="MyList" />
            <Property Name="Language" Value="1033" />
            <Property Name="FeatureID" Value="{3A71B642-D88C-48A4-BEB7-FC8DD4EFF9FE}" />
        </File>
</Module>

Explanation here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.