我有一个自定义页面库,其中自定义内容类型和页面布局都在一个站点定义中。
按照预期工作。我唯一不能解决的问题是,如果我通过stsadm使用page-lib,ctype,page-layout升级解决方案,那么除了page-layout之外,所有的东西都会更新。
ctype中的新字段-->在页面中更改视图没有问题-lib -->没有问题
已更新PageLayout -->错误
页面布局部分:
<!-- 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>奇怪的是,如果我只有一个没有底层页面库的页面布局,我可以更新页面布局。只有当我在自定义页面库中使用自定义页面布局时,才会出现这个问题。
我做了一些谷歌搜索,发现了一个提示--问题可能是页面布局没有托管。我用一小段示例代码对此进行了检查:
SPFile file = folder.Files["Default.aspx"];
if (file.CustomizedPageStatus == SPCustomizedPageStatus.Customized)
{
file.RevertContentStream();
}在执行代码之后,page-layout被升级并使用新的Page-Layout。
问题是,这对我来说并不是真正的解决方案,因为我有大约。使用site-def的1000个站点集合。和页面布局。更新所有这些都是非常痛苦的。有没有人知道解决这个问题的办法?
发布于 2009-07-29 17:52:46
我想对一件事发表评论。参考此link,看起来IgnoreIfAlreadyExists="TRUE“不能正常工作,将值恢复为FALSE应该会有所帮助。
<File Url="CustomPage.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >https://stackoverflow.com/questions/1201230
复制相似问题