This project is read-only.

How to fetch custom field in Orchard?

Topics: Writing modules
Jun 3, 2011 at 2:25 PM


I have added few custom fields to a User content type.

How to fetch those fields from the user content type using the ContentManager?

Best regards,


Jun 3, 2011 at 5:01 PM

var contentItem =...;


Jun 6, 2011 at 11:50 AM


Jun 6, 2011 at 2:51 PM

@Anna: But look out for naming issues - if the field is named the same as some property existing on that part - the field will be used instead (it has priority over existing properties).

Jun 6, 2011 at 3:06 PM

Also just a slight fix to sebastien's post; to access fields in that way you have to make sure the ContentItem is treated as dynamic:

dynamic contentItem =...;