That property should work. Is this a EPiServer 6 style custom property appearing in the new edit view?
Hi Ben,
Yes, this is a EPiServer 6 style custom property. Is it possible to use any other property in EPiServer to determine if we are in edit mode or not?
I've just investigated the legacy properties dialog and it seems there is a bug. The URL to load the custom property doesn't contain epieditmode=true in the query string.
This means that PageIsInEditMode will always return false since that property will only ever be true if the URL contains epieditmode=true in the query string.
I'll log a bug for this.
I'm not sure how you could work around this. My first suggestion would be to try convert the property to an EPiServer 7 style custom property.
Do you mean inside a CMS 6 property control? I don't think we should or need to use the PageIsInEditMode property since legacy editor dialog is not actually new edit mode :).
By the way, checking the control's RenderType property can help in this case.
Inside a MVC view I use
@if(PageEditing.PageIsInEditMode)
{
}
which is from EPiServer.Editor namespace
You also need to be on EPiServer 7 - patch 1
Hi Ben,
thanks for finding that out! Could you also check why the PageLink is Null here?
@Duong Nguyen: I am inside the PropertyData class and not the PropertyDataControl.
@EPiDev: I am inside the PropertyData class, so this won`t help me much....
Hi Ben,
Is this bug still there in EPiServer 7 Patch 4? Another thing, PageLink is also null here. Is this also a bug?
Hi,
Is it possible to check if a user is in edit mode inside a custom property? EPiServer.Editor.PageEditing.PageIsInEditMode is always false
/Tore