Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is there anyway to get a value from an unpublished node?
Here's my code :
public JsonResult<String> GetData()
var id = HttpContext.Current.Request.QueryString["id"];
dynamic properties = Umbraco.Content(Convert.ToInt32(id));
If I go to the BackOffice and chage the value of "Data" and just Save It, my method always return the last published version instead of my new saved, but unpublished one.
Would this work? I've used this to query for reviews tagged to unpublished locations, worked great for me.
There's a check in the API to see if something is published, you could just filter for the opposite.
I tried it, but when I use the getValue method from the IContent returned by the query, it always return me null.
That's said, I don't think it will see the difference between my published value and my saved value.
I finally get this to work with the API. Yeah!
Keep in mind if you use the ContentService you are talking directly to the database. This approach might not scale if your site receives a lot of visitors.
You're right! Is there a more performant way to do this?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted