I’m getting this error:
‘Orchard.ContentManagement.ContentItem’ does not contain a definition for ‘LatestProductPublicationPreview’
I have created the Content Type with the same name, and set it to “Widget”.
This is the line failing in the view:
var contentType = Model.ContentItem.LatestProductPublicationPreview;
Any ideas?
That’s because there is no LatestProductPublicationPreview property on ContentItem. It’s hard to tell what you’re trying to do from what little information there is in the question, or what you expect but I’ll try. Are you saying that you have a content type named LatestProductPublicationPreview? If so, you don’t have to specify that, in general. If you want to get to the title part of that content item, you’d do Model.ContentItem.TitlePart. Now if you want to access the Value property of field Foo, you’d do Model.ContentItem.LatestProductPublicationPreview.Foo.Value. etc.