Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gerty Engrie 130 posts 490 karma points c-trib
    Apr 22, 2016 @ 09:30
    Gerty Engrie
    0

    Detect difference between preview modes

    Hello,

    i was wondering if there is a way to detect whether a user is browsing in preview mode through the backend so f.e. http://a.local/umbraco/preview/?id=1145#?id=1145 or through the preview mode on the frontend f.e. http://a.local/custom-url

    thanks :)

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Apr 22, 2016 @ 10:07
    Alex Skrypnyk
    1

    Hi Grety,

    You can try to use:

    Umbraco.UmbracoContext.InPreviewMode
    

    Cheers

  • Gerty Engrie 130 posts 490 karma points c-trib
    Apr 22, 2016 @ 12:04
    Gerty Engrie
    0

    Thanks, but the InPreviewMode is true for both cases. So is the IsFrontEndUmbracoRequest variable. Both are true for both cases.

    For now I've checked if the first segment of the url is numeric... but that's just dirty. Would love to change it to something cleaner.

Please Sign in or register to post replies

Write your reply to:

Draft