Mahbubur Rahman Manik
Mahbubur Rahman Manik

Reputation: 5161

Sitecore.Context.PageMode.IsPageEditor VS Sitecore.Context.PageMode.IsExperienceEditor

Inside a rendering, I have some code like this:

 @if (!Model.Item.IsFieldEmpty(ContentBlock.Title) || Sitecore.Context.PageMode.IsPageEditor)
    {
        <h2>
            @Html.Sitecore().RenderField(ContentBlock.Title, Model.Item)
        </h2>
    }

It still works fine for me. But i am getting an warning like 'Sitecore.Context.PageMode.IsPageEditor' is obsolete : use IsExperienceEditor instead. What's the difference between them ??

Note: currently i am using sitecore 8.1.

Upvotes: 2

Views: 1826

Answers (2)

Arbejdsgl&#230;de
Arbejdsgl&#230;de

Reputation: 14088

The différence only in name convention, Page Editor has a new name in Sitecore 8 = Experience Editor.

I strongly recoment you use new name.

Upvotes: 0

Sandbeck
Sandbeck

Reputation: 366

PageEditor is the named used pre Sitecore 8 - they changed it to Experience Editor. So it is the same thing, but the old name is deprecated and might be removed in newer versions.

Upvotes: 3

Related Questions