Copied to clipboard

Flag this post as spam?

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


  • Simone Chiaretta 134 posts 541 karma points c-trib
    Sep 19, 2017 @ 13:35
    Simone Chiaretta
    0

    Preview unpublished pages by anonymous users

    I'm in a situation in which I need to allow anonymous users to preview unpublished (or new unpublished version of published ) content.

    I've searched the forum and found some posts about this but most of them come up with "you can't do it".

    Some says to use Courier, run an Approval server where everyone can see content. But we don't have that setup unfortunately.

    I think it boils down to removing the authorization checks on the preview pages, but it requires knowledge on core code base I don't have.

    Anyone found a solution for this?

  • Ayo Adesina 424 posts 1006 karma points
    Sep 19, 2017 @ 16:03
    Ayo Adesina
    0

    Intresting question, I would like to know if this is possible. (just out of interest)

    but guessing, I would think it probably isn't possible, my instinct tells me that the authorization features applied globally to the back office and making it not apply to XYZ parts of it will not be possible with out lots of changes to the core...........(I maybe wrong)

    Another approach would be, this.

    1. Authorized user makes changes, saves but not published.
    2. On the frontend provide a page that displays all unpublished pages
    3. When a user clicks on of the pages you take them to another page that under the hood goes to umbraco gets the data for the unpulished page and displays it.

      • Warning... This is thought up in about 5 mins of reading your question and maybe completely wrong.*
  • Simone Chiaretta 134 posts 541 karma points c-trib
    Sep 19, 2017 @ 16:10
    Simone Chiaretta
    0

    This indeed a possible solution. Basically you say that the page, instead of relying on the umbraco cache, gets the data straight out of the DB.

    The only issue I see is that now the umbraco controller will not have the document model already there, but would need to build it itself... so might be a bit complicate with the dozens of doctypes we have.

    Thx for the idea

  • Ayo Adesina 424 posts 1006 karma points
    Sep 19, 2017 @ 17:43
    Ayo Adesina
    0

    Pass in the id of the content node then use the content service API to get it?

  • Simone Chiaretta 134 posts 541 karma points c-trib
    Sep 19, 2017 @ 18:31
    Simone Chiaretta
    0

    yeah, but then from IContent I need to get an IPublishedContent and getting it back with ModelBuilder classes.

  • Dave Woestenborghs 3429 posts 11693 karma points MVP 7x admin c-trib
    Sep 19, 2017 @ 19:35
    Dave Woestenborghs
    0

    Hi Simone,

    We have some code for converting IContent to IPublishedContent... Jeroen talks about it in this article : https://24days.in/umbraco-cms/2016/umbraco-edge-case-stories/

    Dave

  • Simone Chiaretta 134 posts 541 karma points c-trib
    Sep 19, 2017 @ 19:41
    Simone Chiaretta
    0

    Yeah, I know that article... probably half the forum threads in the last 2 years have a link to it :)

    Jokes aside.. messing up with the standard frontend controllers and changing all of them in order to get them work in preview mode seems a bit too much work.

    I was hoping to just remove somehow the check on the backend authorization and use the standard preview functionality.

  • Phil Atkinson 51 posts 244 karma points
    Sep 20, 2017 @ 12:31
    Phil Atkinson
    0

    we used the content API and made some small changes to the code to make it work

  • Simone Chiaretta 134 posts 541 karma points c-trib
    Sep 20, 2017 @ 12:34
    Simone Chiaretta
    1

    Could you elaborate a bit more if possible? :)

  • Phil Atkinson 51 posts 244 karma points
    Sep 21, 2017 @ 09:44
    Phil Atkinson
    0

    we are using a custom version of shannon's Umbraco.Api package. we modified the contentcontroller so content can be requested and rendered even if unpublished. this is what the umbraco preview button does anyway.

    use the PreviewContent object alongside Umbraco.RenderTemplate:

  • tiago.santos 4 posts 73 karma points
    Feb 08, 2021 @ 10:55
    tiago.santos
    0

    I'm sorry for resurrecting this topic. But I'm facing exactly the same request from a client. They want to share a preview URL to some members of the administration, and don't want them to login...

    We are using the latest version Umbraco V8

    Our plan B is to create a generic User only with Viewer permissions and make them login :(

    We appreciate your help

  • Artyom Chernenko 17 posts 91 karma points
    Feb 16, 2021 @ 09:41
    Artyom Chernenko
    0

    I'm also facing the same request from a client! Looks like it is a feature request :)

    Any thoughts on this?

  • Nik 1512 posts 6679 karma points MVP 5x c-trib
    Feb 16, 2021 @ 11:41
    Nik
    2

    Hey Artyom

    If you are trying to do this with Umbraco v8.9 and newer there is a package to help

    https://our.umbraco.com/packages/backoffice-extensions/truepeoplesharepreview/

    Cheers Nik

  • Artyom Chernenko 17 posts 91 karma points
    Feb 16, 2021 @ 12:00
    Artyom Chernenko
    1

    I am on 8.8, but I will give it a try and probably consider upgrading if there are issues. Thanks for your help, Nik!

Please Sign in or register to post replies

Write your reply to:

Draft