This project is read-only.

How to Access a Field Added to a Content Type in code.

Topics: Customizing Orchard
Jan 26, 2012 at 8:12 AM

Hi all,

How could I access a custom field (i.e, ImageField) in a Content Item?

My scenario is that I made a Content Item that is Containable and has an Image Field part. I need to display the Image from the Image Field in a Container Widget alternate by modifying the `Parts.Common.Body.Summary-<MyContainableItem>`.

Thanks for the help and please let me know if I'm doing it wrong or there is already an existing solution to my problem.


Jan 31, 2012 at 6:26 AM


dynamic c = yourContentItem;

var foo = c.NameOfTheContentType.NameOfTheField.SomePropertyOfTheField

Feb 1, 2012 at 7:52 AM


Thanks, it worked great!