Working with the Media module, I want audio and video files to show (user uploaded/selected) preview images when displayed in areas throughout the site (instead of the default soundwave and film clip image.) So, I added fields to those files type entities, but since Image can be it’s own preview, I didn’t add that field (since it would seem odd to make the user upload/choose the image again.) This has become a GIANT pain when trying to figure out how to show all the file types together in a single view. (I want it to show field_image for audio and video, but the file for images.)

Does that sound undoable? Nothing I've been able to try with views and relationships gets me what I need. I tried customizing the preview display mode for each, then display the "rendered entity" (which got me what I needed for displaying the images), but left me with other issues, since I was displaying field_image fields for some, but file fields for others.

Slight Update: I tried adding the field_image field to the image file type, but that seems to cause some kind of infinite loop/server error when viewing/editing that file anywhere.

1 Answer 1


What I ended up doing was just add custom tpl.php files for each of the types I was interested in (audio/video/images; e.g. file--image.tpl.php). Then, in the views, just say to render the entity instead of using fields.

I'd have liked a more elegant way, since I now have 3 more tpl.php files to worry about, but it DID fit the bill.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.