This project is read-only.

ContentPicker rendering

Topics: Customizing Orchard
Nov 22, 2012 at 4:16 PM
Edited Nov 22, 2012 at 4:18 PM


I have a simple scenario: I've created a content type (say MyUser as an example) to hold user information. This content type has some custom fields, including a media picker to choose a picture.

I then have another content type to hold location information, let's name it MyLocation. In MyLocation content type, I have included a ContentPicker field that accept multiple entries. I'm using this field to assign users to locations.

When I render MyLocation, ContentPicker just lists the pointed content by title with a link to access it. Is it possible, instead of using the title, to display the picture that is set on MyUser content item? In view, content picker field cycles through ContentItems and use ItemDisplayLink to display the link. Can I customize the link and use a field in contentItem? Or is there a better way to realize what I'm trying to do?

Thanks in advance for your help.

Nov 22, 2012 at 6:43 PM

Found a way. In alternate for ContentPicker, I use BuildDisplay to render summary view. I'm not sure it's the right way to do it, but it works. It let me customize the rendering of ContentPicker items in the view. Feedback welcome if I should go another way.