Create a function to load a site template file (.stp) into MOSS

Following this question , I created a function to download a site template file as part of an automated build for a SharePoint site. However, while the function correctly deploys the .stp file in the hive and the solution appears in CAS | Operations | Decision management page, site template is not showing in the site template gallery as expected. I have given the contents of the feature.xml and elements.xml files below; can anyone find out where i am going wrong?

feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="59627434-4B75-4f9c-B830-E6E34007DA70"
          Title=" Team Site Template"
          Description="UKTI Connect Team Site Template"
          Version="12.0.0.0"
          Hidden="FALSE"
          Scope="Web"
          DefaultResourceFile="core"
          xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml"/>
    <ElementFile Location="TeamSiteTemplate.stp" />
  </ElementManifests>
</Feature>

      

Elements.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="TeamSiteTemplate" Url="_catalogs/wt" RootWebOnly="TRUE" >
      <File Url="TeamSiteTemplate.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE">
        <Property Name="LanguageDisplay" Value="English" />
        <Property Name="Version" Value="3" />
      </File>
  </Module>
</Elements>

      

Thanks, MagicAndi

+2


source to share


2 answers


This element.xml works:

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

      

There are minor differences, but the one that probably solves the problem is the inclusion of the attribute List

.



To explain, %CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML

see the line containing the words sitetemplategalleryList

. This shows Type="111"

what matches List="111"

in the .xml elements.

Also note that I set the function to the site area as Colin suggested.

+4


source


Have you tried to set the scope of this feature to the site?



0


source







All Articles