在 MOSS 中创建上传站点模板文件 (.stp) 的功能
继这个问题之后,我创建了一个功能来上传网站模板文件作为 SharePoint 网站自动构建的一部分。但是,虽然该功能将 .stp 文件正确部署到配置单元,并且解决方案出现在 CAS | 中。运营|解决方案管理页面中,站点模板未按预期出现在站点模板库中。我在下面给出了 feature.xml 和 elements.xml 文件的内容;谁能发现我哪里出错了?
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
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>
Thanks, MagicAndi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个 elements.xml 有效:
存在细微差别,但可能解决问题的是包含
List
属性。为了解释这一点,请在
%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML
中查看包含单词sitetemplategalleryList
的行。这显示了与 elements.xml 中的List="111"
相对应的Type="111"
。另请注意,我按照 Colin 的建议将该功能设置为站点范围。
This elements.xml works:
There are minor differences but the one that probably solves the problem is the inclusion of the
List
attribute.To explain, in
%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML
see the line containing the wordssitetemplategalleryList
. This showsType="111"
which corresponds toList="111"
in elements.xml.Also note that I set the feature to Site scope as Colin suggested.
您是否尝试过将功能范围设置为“站点”?
Have you tried setting the scope of the feature to Site?