MediaLibraryPickerFields not displaying?

Topics: General, Troubleshooting
Aug 8, 2014 at 6:19 AM
Hey Guys, how come MediaLibraryPickerFields attached to a custom content type dont display their image in queries with any layout [using 1.8.1] - and how does one go about displaying said image/s? So far I can only see images via "Dashboard \ Content Definition \ List Items [or previewing the content type directly], nowhere else? Please help. Thanks in anticipation, cheers Dyr
Aug 8, 2014 at 8:30 AM
In a query layout you can access the image url with a token like this: {Content.Fields.YourContentTypeName.YourImageFieldName.Url}

Then you can display it in a query like following: <img src="{Content.Fields.YourContentTypeName.YourImageFieldName.Url}" />
Aug 8, 2014 at 9:21 AM
Hi sanderg, thanks for the reply, mate - I must be really dense, as I tried the above earlier after reading:
http://stackoverflow.com/questions/17888031/how-can-i-display-images-with-projection-layouts-in-orchard-1-7
...but I'm obviously not following correctly, as I couldn't get it to work.
In regards to:
Then you can display it in a query like following: <img src="{Content.Fields.YourContentTypeName.YourImageFieldName.Url}" />
are you referring to an alternate or editing a projection layout directly? Sorry for needing clarification on something that is no-doubt ridiculously simple. Cheers Dyr
Aug 8, 2014 at 11:40 AM
Edited Aug 8, 2014 at 11:41 AM
No problemo!

I meant in the query layout, add a property 'custom value' and then rewrite the whole output to what I mentioned earlier. This is how I've done it:
Image

Where CategoriesTerm is the name of my contenttype and Image is the name of my MediaPickerLibraryField field.

BTW, there's nothing simple about it. Its just a matter of knowing ;)
Aug 10, 2014 at 2:55 AM
Legend! Thanks for your time/effort sanderg, very handy to know, cheers Dyr
Aug 11, 2014 at 8:49 AM
Any time :)