This project is read-only.

Determine if content item has a TitlePart

Topics: Core, Customizing Orchard
Oct 7, 2014 at 11:45 PM
I'm trying to determine whether or not a content item has a TitlePart. I've grabbed a content item and tried using the .Has() method to determine if it has a TitlePart but I get an error that says Compiler Error Message: CS0118: 'Orchard.Core.Title.Models.TitlePart' is a 'type' but is used like a 'variable'

Any ideas? Thanks.
Oct 8, 2014 at 8:01 AM
Can you post your code snippet?
Oct 8, 2014 at 4:09 PM
if (contentItem.Has<TitlePart>()) {
this should work.
Marked as answer by emeraldarcher on 10/8/2014 at 8:59 AM