Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
Hoping this is a straight forward question, but can anyone tell me what the code is to check if a page is in preview mode. I know what it was in Umbraco 7, but doesn't seem to work in 8.
Thanks
One thing you will find when in preview mode is a cookie named UMB_PREVIEW with the value preview. When that guy exist, you are in preview mode.
UMB_PREVIEW
preview
The UmbracoContext also hold a flag telling you if it is preview mode: UmbracoContext.InPreviewMode
UmbracoContext.InPreviewMode
This works with Umbraco 7, doesn't work with Umbraco 8+
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to check for Preview Mode in Umbraco 8
Hello,
Hoping this is a straight forward question, but can anyone tell me what the code is to check if a page is in preview mode. I know what it was in Umbraco 7, but doesn't seem to work in 8.
Thanks
One thing you will find when in preview mode is a cookie named
UMB_PREVIEW
with the valuepreview
. When that guy exist, you are in preview mode.The UmbracoContext also hold a flag telling you if it is preview mode:
UmbracoContext.InPreviewMode
This works with Umbraco 7, doesn't work with Umbraco 8+
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.