+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / News Draft Items Display

News Draft Items Display

2 posts, 0 answered
  1. William
    William avatar
    108 posts
    Registered:
    15 Feb 2011
    28 Nov 2011
    Link to this post
    Hey Telerik,

    I'm using the following code to grab a list of news items:
    IList listOfNewsItems = newsManager.Content.GetContent("Sort", filter.ToArray());

    What I notice is that if I create item A and publish it and then edit it (creating the case where there's a Published version and a Draft version too), the item contained in the list will always be the Published, not Draft version. That's of course, expected behavior.

    What I need to do in another step, though, is get at the Draft versions of Published items.  So I need to look at A's Draft version, not A's Published version.

    Using this:
    newsManager.Content.GetCurrentState(newsItem.ID, true, true).Status
    or
    newsManager.Content.GetStagedContent(newsItem.ID).Status

    always returns "Published" for item A.

    How can I see the content programmatically for A's Draft?

    Thanks

    - William


  2. William
    William avatar
    108 posts
    Registered:
    15 Feb 2011
    29 Nov 2011
    Link to this post
    A bit more detail here,

    What would be awesome, really, is to be able to get at the latest version of an already existing News Item that's been previously published and is now undergoing editing.  In other words (forgetting rollbacks) there seem to be two versions of a News Item, one that is published and one that is in edit (Draft, Approved, etc). 

    So, if that item is Draft, Approved, etc, I'd like to be able to access that information as well as accessing the Published item as well.

    I'm assuming there's a way to do that, as it's being done obviously in the backend. I just don't know if that's something easily attainable.  I'm assuming that the latest version is what I'm after.

    Here's a code block of sorts, which I'm trying to fill in..

    IList listOfNewsItems = newsManager.Content.GetContent("Sort", filter.ToArray());
     
    foreach (Telerik.Cms.Engine.IContent newsItem in listOfNewsItems)
    {
         // Also grab the Draft, Approved, etc version if it exists here.
    }


    Thanks!

    - William
2 posts, 0 answered