I've got a module that allows members to add content items. These content items are shown on the front-end website, once that user has logged in. The module has a UserID metafield, so I can easily show the logged-in user just the content items that belong to him/her. I use the following code to do so:
//create an instance of the contentmanager
//get all publications
//filter content items based on userID
List<IMetaSearchInfo> oFilter =
, Membership.GetUser().ProviderUserKey.ToString(), SearchCondition.Equal));
IList oContentItems = _oContentMgr.GetContent(0, 0,
If I login to the SiteFinity Admin and look at the current content items, there are three. 2 are ForApproval, although they have been published previously (they have just been updated) and 1 is Published. When I run the code above all 3 records that are returned have a status of Published. I'm sure that is By Design because generally you want GetContent to return the latest published version of each content.
My scenario is that I want the logged-in user to see whether the latest version they updated has been published. I can loop through the IversionItem for each Content Item, but the IVersionItem doesnt indicate whether it is the published version. Is there anyway of working out whether the latest IVersionItem is published? The only way I can think of doing it is to compare the IVersionItem.Data[N].Data against ContentItem.GetMetaData("MetaFieldKey") and check whether each one of them is the same. Any better ideas?