1

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

4
  • Is the locale for your site something other than English (US)?
    – James Love
    Commented Mar 14, 2011 at 18:44
  • Nope, it's english. When I upload it through the UI, it also takes the language value of 1033.
    – tarjeieo
    Commented Mar 15, 2011 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
    Commented Mar 15, 2011 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.
    – Geeky Guy
    Commented Nov 25, 2013 at 22:56

3 Answers 3

1

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

0

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>
1
  • 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
    Commented Mar 15, 2011 at 7:03
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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