This project is read-only.

Version Manager - Getting Content Item Info

Topics: Customizing Orchard
Mar 2, 2015 at 6:50 PM
Edited Mar 2, 2015 at 6:55 PM
I'm trying to update Arana.Version Manager to include more information on the version of the content item in it's list of versions. I'm trying to get the owner of the version and when the version was published/created. The List view gets every version of the specified content item and loops through displaying which version and whether it's the latest or not. I would like to include who the owner of the version was and when it was created and when it was published. I'm trying to grab this info from the item's version record but can't seem to get it working.

Here is what I have so far:
<h3>@T("Version {0}", item.Version)</h3> @T("(Version Record Id: {0})", item.VersionRecord.Id) @T("Published by: {0}", item.VersionRecord.Data.As<Orchard.Core.Common.Models.CommonPart>().Owner)
I'm attempting to get the data from the version record for the item and grab what is stored in the CommonPart's Owner. This however returns a null object. How do you grab the individual data from a version record's data? Thank you.

Edit: I also ran into a problem with trying to display in the ListDeleted view the user that deleted the content item and when they deleted it. Does Orchard save this data for the content item?
Mar 2, 2015 at 7:08 PM
I know this has been accomplished by the Audit Trail module in the current dev branch of Orchard. Any ideas when 1.9 is going to be released?
Mar 2, 2015 at 7:23 PM
Try this