Copied to clipboard

Flag this post as spam?

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


  • Alan Mac Kenna 147 posts 405 karma points MVP c-trib
    Nov 08, 2017 @ 15:46
    Alan Mac Kenna
    0

    Documentation

    Hello!

    Just wondering is there documentation on usage? Specifically how to create backoffice previews of content? I can't seem to find it.

    Thanks,

    Alan

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Nov 08, 2017 @ 16:15
    Nik
    103

    Hi Alan,

    I don't believe there is detailed documentation yet, however in order to get back office preview working there are a few steps to adhere to.

    1) in Views/Partials create a folder called "stack" 2) Create cshtml views who's name match the alias of the document type you are previewing - e.g. "programmeEntry" 3) Ensure these views inherit from UmbracoViewPage

    These worked for me as these are the rules that StackedContent uses to look for its views. It doesn't use Angular Views in the preview which is key to remember.

    Nik

  • Alan Mac Kenna 147 posts 405 karma points MVP c-trib
    Nov 08, 2017 @ 17:28
    Alan Mac Kenna
    0

    nice one Nik, that worked a treat.

  • Mark Drake 134 posts 458 karma points c-trib
    Dec 28, 2017 @ 19:23
    Mark Drake
    0

    What's the recommended way to check (in the custom view) if we are rendering in the back office, vs rendering on the front end?

    I suppose something like this would work in the view file:

    bool isFrontEnd = UmbracoContext.Current.IsFrontEndUmbracoRequest;

    (Pulled from LeBlender actually)

    This shouldn't have any effect on cache though? If I provide alternate HTML when viewed from the back office vs front end?

Please Sign in or register to post replies

Write your reply to:

Draft