November Happy Hour will be moved to Thursday December 5th.

Detect if preview mode

Vote:
 

Is it possible to detect if the page is rendered in previewmode. It seems like the request is exactly the same as in edit mode?

#75528
Sep 27, 2013 14:05
Vote:
 

For me, when I check 

bool inEditMode = PageEditing.PageIsInEditMode;

is false when in preview mode.

I set a class to my container div according to this info, so I can use it in js.
Also, I have active=true in the querystring, don't you?

See a screenshot: http://postimg.org/image/krv6lr793/

Perhaps I misunderstood you?

#75529
Edited, Sep 27, 2013 15:23
Vote:
 

Actually, I get 'true' from that parameter in preview-mode. Looking at your screenshot, my url doesn't change at all. What version of Episerver do you use?

#75532
Sep 27, 2013 15:52
Vote:
 

Yes, the fact that a version could be different crossed my mind too, as I don't remembed having this extended preview before I did the upgrade. I have 7.0.586.16 (should be the latest version). How about you?

#75533
Sep 27, 2013 15:55
Vote:
 

I'm using 7.0.586.1. But it seems like you have a UI-addon installed (can see the "SV" icon in yourscreenshot), I installed that addon in another project (7.0.586.8) but have the same issue in that project. I'll try to install the latest UI, maybe that will help

Regarding the querystring in your screeenshot, "viewsetting=active:///true" is only changed when clicking on the icon for "toggle view settings" (the icon that looks like an eye). The preview-button doesn't seem to change the url

#75578
Sep 30, 2013 15:43
Vote:
 

It's the same when I click preview, the value inEditMode is false.

It might be the version, now I have also upgraded to the latest patch 4.

#75581
Sep 30, 2013 16:25
Vote:
 

Upgrading to 7.0.586.24 fixed this issue. The preview works fine for me now

#75585
Sep 30, 2013 16:49
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.