
Hieu Bui (Customer) asked a question.
[.NET Core Renderer] How to show preview data in preview/edit mode and live data in live mode with rest sdk?
I've tried to change Live to Master in webservice setting, but it's only return correct status, if that item save draft with published before, it's will not return in live mode,
could you help give me any advise for this?
Thanks
Hi Hieu,
Yes, this is the expected behavior. When you select Master in the webservice setting it returns all the items in Master. So if you have a published item and then you edit and save as draft it will copy the changes to the Master and you will see only the latest changes saved as draft.
I am curious about the use case for this? Do you need it for all content types, only for specific content types? What is the use case?
At the moment I can't think of any way of showing the draft versions of the items in the edit and preview mode. Definitely not straight forward way. If I know more details maybe I can help better.
Regards,
Sabrie
Hi Sabrie,
Thanks for you replied, about "What is the use case?", this is my use case:
when editor update some item and save as draft, editor want to check the data show on preview or edit mode on all dynamic modules, that is the requirement, so not sure how we will handle that.
I've searched and maybe can use custom endpoint, but it's need to development.
Thanks,,
Hieu
If you are using a dynamic module in order to Preview to work you will need to have a Content List widget on a page configured to show the content type you want. Once this is done you can preview items from the content item editing page. When using the preview button it will show the current or draft version.
Hi Jonathan,
Thanks for you replied,
I know this concept, but the requirement of editor is preview all item in page, example: a page use 5 widget with 5 difference dynamic module with difference UI, so I think above way can't handle it?
do you have any other solution?
Thanks,
Hieu
Pages also support previewing but content list always pull the live version of content items. You would have to customize several things in order to support pulling a draft version of a dynamic content item to show in preview mode. I would have to think a while on how to support this.
Most customers in this type of scenario choose to use SiteSync. This way a lower environment becomes the preview for the future of production. Publish all the items in the lower environment that way you can see all the changes then when ready SiteSync all the item or custom selection to the production version.
Hi Hieu,
Thanks for the details. I better understand what you need as an end result now.
I thought a lot what we can do to achieve this even if some customizations are needed. But I don't think it is possible. At the end of the day the renderer gets the items either in Master or in Live status (as configured in the WebServices settings) and it is not possible to load Master in Edit/Preview and Live on the frontend.
I think the SiteSync option could be what would solve your problem. On the authoring environment you can create, publish and review content and when you want to make it available on the live website just sync it to the live website and that's it.
Regards,
Sabrie