Query layout help?

Topics: General
Mar 14, 2012 at 5:05 AM

Hey guys, I’ve watched ‘Orchard CMS: a preview of the Projector module’ on youtube so I could create a ‘query layout’ to display my data; the problem is, I’m using the ‘Image Field Module’ and wish to display an image with each node in my list. The point is, when I try to add the image field via 'add a property', it is not displayed there to do so? So how do I add the image to the summary list [...the image displays fine in the details view]? Thank you for your time, pg

Mar 14, 2012 at 5:48 AM

Isn't it available to add from bindings?

Mar 14, 2012 at 6:13 AM
Edited Mar 14, 2012 at 6:24 AM

Sorry, I'm not sure what you mean - maybe I need to watch the video again - where is this feature and how can I add it from bindings? Thanks pg

EDIT: OK found this feature -- going through the list now, so far I can't find it - maybe I have to add Contrib.ImageField module to the solution?

Mar 14, 2012 at 6:37 AM

You;re right, fields are not in bindings, they should just show up in the choices for layout once you've switched it to property mode.

Mar 14, 2012 at 7:21 AM

Well this is a pickle - any idea why it's not (...as in, bug on the projections module side or image field module)?  If this turns into a dead-end, what is the best way to achieve what I originally desired? Thanks pg

Mar 14, 2012 at 7:40 AM

I'd compare that field's code with the code of fields that work (like text field or media picker field). There's got to be a difference that explains why it doesn't show up.

Mar 14, 2012 at 5:50 PM

The ImageField needs to be migrated to be compatible with projections. You can do it by yourself in the meantime. You just need the Describe() method from the Driver. Please take a look at the drivers in Orchard.Fields to see how it works.

Mar 15, 2012 at 12:07 AM

thanks bertrandleroy and sebastienros I did exactly that, added the following to ‘ImageFieldDriver’:

protected override void Describe(DescribeMembersContext context)

               .Member(null, typeof(string), T("FileName"), T("The File Name of the media."));
Cheers pg.