Copied to clipboard

Flag this post as spam?

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


  • Huy Tran Quang 3 posts 83 karma points
    Apr 05, 2018 @ 03:34
    Huy Tran Quang
    0

    How to preview node without publish

    Hi,

    I have an issue with Preview mode. I want to view my unpublished node. And this is my content tree:

    • Home
      • About Us
      • Services
      • Technology
      • Contact Us

    I want to preview About Us node and this node get content from Home and other nodes (such as Technology, Contact Us...etc). And code show that it can't get Home, Technology, Contact Us node because they aren't published.

    Are there any way I can view without publish all nodes?

    Thank in advance!

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 05, 2018 @ 07:14
    Michaël Vanbrabandt
    0

    Hi Huy,

    first of all welcome to the friendly Umbraco community!

    If I understand your question, you have some nodes that are not published and which you want to access inside your About Us page in preview mode correct?

    Because only published nodes are in the Umbraco cache, it won't be possible to use the cache to render content. A possibility would be using the ContentService api to fetch the unpublished pages from the database but then when going live you need to change it back to using the content cache.

    Docs about the ContentService api: https://our.umbraco.org/documentation/reference/management/services/contentservice

    Hope this helps!

    /Michaël

  • Huy Tran Quang 3 posts 83 karma points
    Apr 10, 2018 @ 08:05
    Huy Tran Quang
    0

    Hi Michaël,

    This solution is good if I use at my local. But I have to send code to my clients. And this solution makes them confused a bit.

    Thank Michaël!

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Apr 05, 2018 @ 07:17
    Dave Woestenborghs
    100

    Hi Huy,

    Jeroen Breuer wrote about this on : https://24days.in/umbraco-cms/2016/umbraco-edge-case-stories/

    Dave

  • Huy Tran Quang 3 posts 83 karma points
    Apr 10, 2018 @ 08:06
    Huy Tran Quang
    0

    Hi Dave,

    It looks like this solution is possible. I will try it.

    Thank Dave very much! Huy Tran

Please Sign in or register to post replies

Write your reply to:

Draft