创建功能以在MOSS中上载站点模板文件(.stp) [英] Create Feature to Upload Site Template File (.stp) in MOSS
问题描述
根据此问题,我创建了一个功能上传网站模板文件作为SharePoint网站自动构建的一部分.但是,虽然该功能将.stp文件正确部署到配置单元中,但解决方案出现在CAS |运营|在解决方案管理"页面上,站点模板未按预期出现在站点模板库中.我在下面给出了feature.xml和elements.xml文件的内容;谁能发现我要去哪里错了?
Following on from this question, I have created a feature to upload an site template file as part of an automated build of a SharePoint site. However, while the feature deploys the .stp file correctly to the hive, and the solution appears in the CAS | Operations | Solution Management page, the site template does not appear in the site template gallery as expected. I have given the contents of the feature.xml and elements.xml files below; can anyone spot 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>
感谢MagicAndi
Thanks, MagicAndi
推荐答案
此elements.xml有效:
This elements.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>
有一些细微的差别,但是可能解决问题的一个是包含List
属性.
There are minor differences but the one that probably solves the problem is the inclusion of the List
attribute.
要说明,请在%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML
中查看包含单词sitetemplategalleryList
的行.这显示Type="111"
,它与elements.xml中的List="111"
对应.
To explain, in %CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML
see the line containing the words sitetemplategalleryList
. This shows Type="111"
which corresponds to List="111"
in elements.xml.
还要注意,我按照Colin的建议将功能设置为网站范围".
Also note that I set the feature to Site scope as Colin suggested.
这篇关于创建功能以在MOSS中上载站点模板文件(.stp)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!