1

Wondering how i can control the markup returned for a Rendered file view mode?

This is within a view, i have a field which is a media file image. I set it to use the Rendered File formatter and provide a view mode i created. But i don't see where i can customize the view mode markup.

<div id="file-28" class="file file-image file-image-jpeg contextual-links-region">

    <h2 class="element-invisible"><a href="/file/msvujpg" class="views-ajax-processed-processed">msvu.jpg</a></h2>


<div class="content">
  <img typeof="foaf:Image" src="http://localhost/sites/default/files/styles/featured_university/public/msvu.jpg?itok=8s4993Zo" width="352" height="240" alt="">  </div>


</div>

The only markup I want returned is

 <img typeof="foaf:Image" src="http://localhost/sites/default/files/styles/featured_university/public/msvu.jpg?itok=8s4993Zo" width="352" height="240" alt="">

I want to get rid of the div's and the whole h2 element.

1

You can create a variation of file_entity.tpl.php from the File Entity module using the following pattern.

file__{file type}__{view mode}.tpl.php

e.g.

file__image__teaser.tpl.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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