首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SharePoint >自定义页面-库& PageLayout

SharePoint >自定义页面-库& PageLayout
EN

Stack Overflow用户
提问于 2009-07-29 15:49:09
回答 1查看 2.2K关注 0票数 1

我有一个自定义页面库,其中自定义内容类型和页面布局都在一个站点定义中。

按照预期工作。我唯一不能解决的问题是,如果我通过stsadm使用page-lib,ctype,page-layout升级解决方案,那么除了page-layout之外,所有的东西都会更新。

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

已更新PageLayout -->错误

页面布局部分:

代码语言:javascript
复制
<!-- 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中的相关部分:

代码语言:javascript
复制
<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>

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

我做了一些谷歌搜索,发现了一个提示--问题可能是页面布局没有托管。我用一小段示例代码对此进行了检查:

代码语言:javascript
复制
SPFile file = folder.Files["Default.aspx"];
 if (file.CustomizedPageStatus == SPCustomizedPageStatus.Customized)
 {
   file.RevertContentStream();
 }

在执行代码之后,page-layout被升级并使用新的Page-Layout。

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-07-29 17:52:46

我想对一件事发表评论。参考此link,看起来IgnoreIfAlreadyExists="TRUE“不能正常工作,将值恢复为FALSE应该会有所帮助。

代码语言:javascript
复制
<File Url="CustomPage.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1201230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档