Display the taxonomy term as an image I'm trying to display the taxonomy term (filter (Better Exposed Filters) on Views) as an image. I added an image field, upload an image (marker). Create template views-view-field--maps--field-type.tpl.php. I found example how to make theming of taxonomy-term here: http://www.milesjcarter.co.uk/blog/web-design-development/drupal-views-templating-tutorial-outputting-respective-image-fields-multiple-taxonomy-term-references

My code looks like:

if(isset($row-&gt;field_field_type)) {
    $term = $row-&gt;field_field_type;
    foreach($term as $type){
        render(field_view_field('taxonomy_term', $type['raw']['taxonomy_term'], 'field_marker', array('label'=&gt;'hidden', 'settings' =&gt; array('image_style' =&gt; 'thumbnail'))));
    }
}


For some reason, the code does not replace taxonomy term, it just show me messages:


  Notice: Only variables should be passed by reference in include()
  (line 8


What could be the reason? I would be grateful for any advice.

I try dpm:

dpm(render(field_view_field('taxonomy_term', $type['raw']['taxonomy_term'], 'field_marker', array('label'=&gt;'hidden', 'settings' =&gt; array('image_style' =&gt; 'thumbnail')))));


And it show me this:

&lt;div class="field field-name-field-marker field-type-image field-label-hidden"&gt;&lt;div class="field-items"&gt;&lt;div class="field-item even"&gt;&lt;img typeof="foaf:Image" class="img-responsive" src="http://localhost/sites/default/files/styles/thumbnail/public/1.png?itok=A6-EJb27" width="63" height="100" alt="" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;


I know that there is a module Taxonomy Image I tried to install it, but after activation necessary functionality was not added to my site.
There are multiple ways to do it. The easiest way would be to use views. You can create a view of taxonomy terms with only an image field and display it as a view block.

See an example of view below.




Let me know if you need any help.