我有一个自定义页面库,它在网站定义中包含自定义内容类型和页面布局。

按预期工作。我唯一无法理解的是,如果我通过stsadm使用page-lib,ctype,page-layout升级解决方案,除页面布局外,一切都会更新。

ctype中的新字段 - >没问题 更改了页面中的视图-lib - >没问题

更新了PageLayout - > ERROR

页面布局部分:

<!-- specific page-layout to display LKW data -->
    <File Url="CustomPage.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >
      <Property Name="Title" Value="$Resources:CustomLayouts,Title;" />
      <Property Name="MasterPageDescription"
                Value="$Resources:cmscore,PageLayout_BlankWebPartPage_Description;" />
      <Property Name="ContentType"
                Value="$Resources:cmscore,contenttype_pagelayout_name;" />
      <Property Name="PublishingPreviewImage"
                Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlankWebPartPage.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlankWebPartPage.png" />
      <Property Name="PublishingAssociatedContentType"
                Value=";#$Resources:FieldsCTypes,cTypeDisplayName;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900D38AAFB8072F441984BC947D49503947;#" />
    </File>

onet.xml中的相关部分:

<Module Name="Home" Url="$Resources:cmscore,List_Pages_UrlName;Custom" Path="">
      <File Url="Default.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
        <Property Name="Title"
                  Value="$Resources:Layouts,DisplayName;" />
        <Property Name="ContentType"
                  Value="$Resources:cmscore,contenttype_welcomepage_name;"/>
        <Property Name="PublishingPageLayout"
                  Value="~SiteCollection/_catalogs/masterpage/CustomPage.aspx, $Resources:PalfingerPlatformsOrderRoot,LKWpageDefaultTitle;" />
        <Property Name="PublishingPageContent"
                  Value="" />
      </File>
    </Module>

奇怪的是,如果我只有一个没有底层页面库的页面布局,我可以更新页面-ayout。 如果我在自定义页面库中使用自定义页面布局,则只会出现此问题。

我做了一些谷歌搜索并发现了一个提示 - 问题可能是页面布局是无效的。 我用一个小样本代码检查了这个:

SPFile file = folder.Files["Default.aspx"];
 if (file.CustomizedPageStatus == SPCustomizedPageStatus.Customized)
 {
   file.RevertContentStream();
 }

执行代码后,页面布局升级并使用新的页面布局。

问题是这对我来说不是真正的解决方案因为我有约。使用site-def的1000个网站集。和页面布局。 更新所有这些都非常痛苦。有人知道这方面的解决方案吗?

有帮助吗?

解决方案

我想评论一件事。看起来像IgnoreIfAlreadyExists =&quot; TRUE&quot;无法正常工作请参阅此链接,可能正在恢复该值假的应该有所帮助。

<File Url="CustomPage.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top