Copied to clipboard

Flag this post as spam?

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

  • Graeme 4 posts 24 karma points
    Oct 07, 2013 @ 13:03

    Last published version of a saved Content node

    I am using the Content Service to output a set of all content nodes, most nodes are in a published state and some have been un-published - I have no problem differentiating between them and can retrieve a clean set of published nodes.

    My problem comes when a previously published node has been updated, saved - but the saved changes have not yet been published.

    The API seems to tag 'starred' nodes as unpublished and my filter ignores them.

    Ideally I need a way to identify these nodes and to retrieve the last published state of them - any ideas?

  • Timon Riemslagh 2 posts 72 karma points
    Jan 15, 2016 @ 10:10
    Timon Riemslagh

    Hello Graeme,

    Did you manage to solve this problem? Is there any one who has the answer?

  • Timon Riemslagh 2 posts 72 karma points
    Jan 15, 2016 @ 12:06
  • nickornotto 395 posts 897 karma points
    Jan 30, 2019 @ 22:41

    Published version has Published property == true

    So you can get last published version this way:

    var versions = ApplicationContext.Services.ContentService.GetVersions(content.Id).OrderByDescending(v => v.UpdateDate).ToList();
    var publishedVersion = versions.FirstOrDefault(n => n.Published);
Please Sign in or register to post replies

Write your reply to: