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?
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.
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:
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!
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
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!
Hi Huy,
Jeroen Breuer wrote about this on : https://24days.in/umbraco-cms/2016/umbraco-edge-case-stories/
Dave
Hi Dave,
It looks like this solution is possible. I will try it.
Thank Dave very much! Huy Tran
is working on a reply...