Copied to clipboard

Flag this post as spam?

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

  • Chris Morley 12 posts 103 karma points
    Sep 01, 2017 @ 09:02
    Chris Morley

    Displaying Latest (saved) content in preview

    We are using umbraco just as an API CMS to return markup through to our website (thus they are on different websites) but when trying to build a custom Preview Page Viewer im struggling to return the latest saved version of the page in place of the latest published version to allow the request to return the markup of the saved version. The main crux of the issue is that running

    requestedItem = UmbracoContext.Current.ContentCache.GetByRoute(isPreview, requestedPath);

    is returning the same content whether we pass a True or a False in to the isPreview flag.

    Some things i've made sure of: A back office user is logged in as part of the preview request so as to allow

    UmbracoContext.Current.Security.CurrentUser != null

    I've made sure the API request is sending an UMB_PREVIEW cookie is sent with a Guid so EnsureInitialized has a previewSet correctly working

    I've looked through the documentation on IPublishedCache, ContextualPublishedContentCache, PreviewContent.cs and a whole lot more but am still not coming up with any ideas on how to correctly return an IPublishedContent of the node

  • Jonny Flanagan 34 posts 163 karma points
    Mar 13, 2018 @ 12:08
    Jonny Flanagan

    Did you resolve this issue Chris? I am interested in doing something similar. Thanks Jonny

Please Sign in or register to post replies

Write your reply to: