Sitecore.Context.PageMode.IsPageEditor与Sitecore.Context.PageMode.IsExperienceEditor

Sitecore.Context.PageMode.IsPageEditor与Sitecore.Context.PageMode.IsExperienceEditor,sitecore,sitecore-mvc,sitecore8.1,Sitecore,Sitecore Mvc,Sitecore8.1,在渲染中,我有如下代码: @if(!Model.Item.IsFieldEmpty(ContentBlock.Title)| | Sitecore.Context.PageMode.IsPageEditor) { @Html.Sitecore().RenderField(ContentBlock.Title,Model.Item) } 这对我来说仍然很好。但是我收到了一条警告,比如“Sitecore.Context.PageMode.IsPageEditor”已经过时:改用iExperienc

在渲染中,我有如下代码:

@if(!Model.Item.IsFieldEmpty(ContentBlock.Title)| | Sitecore.Context.PageMode.IsPageEditor)
{
@Html.Sitecore().RenderField(ContentBlock.Title,Model.Item)
}
这对我来说仍然很好。但是我收到了一条警告,比如“Sitecore.Context.PageMode.IsPageEditor”已经过时:改用iExperienceEditor。它们之间的区别是什么


注意:目前我正在使用sitecore 8.1。

PageEditor是命名的pre-sitecore 8-他们将其更改为Experience Editor。因此,这是同样的事情,但旧名称已被弃用,可能会在新版本中被删除。

仅在名称约定上有所不同,页面编辑器在Sitecore 8=体验编辑器中有一个新名称


我强烈建议你使用新名字

Via ILSpy:[System.Observe(“改用IsExperienceEditor”)]public static bool IsPageEditor{get{return Context.PageMode.IsExperienceEditor;}}}是否都是关于重命名的?是的-它基于Sitecore的新的主要焦点,即“体验”。这也是为什么Email活动经理将名称更改为Email Experience Manager的原因。