What is the best way to show an image of a Plone content type in a listing view?
Let's say I have a folder with Dexterity-based content objects that provide an image field, and I want to list the objects (like the brains of a directory) along with my image. You can display images in a list by calling their absolute URL:
<img src="" tal:attributes="src string:${item/getURL}/@@images/image/thumb" />
Although, Plone will throw an error if the image does not exist, and I don’t see a good way to check if the image exists in the page template. Obviously, we don’t want to wake the objects for printing in order to see the image.
Do I need to create an image metadata column in a directory or is there a better solution that I don't see?
tisto source
share