我有这个功能,通过一个功能插入了一个漂亮的小母版页,它工作得很好。现在我正在研究主题,创建一个可组合的外观。不过,要在设计管理器中选择这种外观,我需要一个预览文件。我通过简单地手动上传预览文件(只是默认文件的副本)成功地完成了此操作。

显然我不想继续这样做,所以我将其添加到母版页功能中,将文件添加到元素文件中。但是当我部署并检查 母版页和页面布局, ,预览文件不存在。母版页以及西雅图和奥斯陆母版页及其预览文件。

我的预览文件在某个地方消失了!

这是 elements.xml 文件:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPages" Url="_catalogs/masterpage" Path="" RootWebOnly="TRUE">
    <File Path="MasterPages\sharepoint_mysite.master" Url="sharepoint_mysite.master" Type="GhostableInLibrary">
      <Property Name="Title" Value="MySite MasterPage" />
      <Property Name="MasterPageDescription" Value="This is the MySite master page." />
    </File>
    <File Path="MasterPages\sharepoint_mysite.preview" Url="MasterPages/sharepoint_mysite.preview">
      <Property Name="Title" Value="MySite MasterPage Preview" />
    </File>
  </Module>
</Elements>
有帮助吗?

解决方案

你应该有 Type="GhostableInLibrary" 预览的属性。

我想您的解决方案中的 MasterPages 指向一个文档库。如果您想将文件从模块提供到文档库, 图书馆里的幽灵 必须使用类型:

指定GhostableInlibrary意味着将文件添加到SharePoint的文档库中

许可以下: CC-BY-SA归因
scroll top