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->field_field_type)) {
$term = $row->field_field_type;
foreach($term as $type){
render(field_view_field('taxonomy_term', $type['raw']['taxonomy_term'], 'field_marker', array('label'=>'hidden', 'settings' => array('image_style' => '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'=>'hidden', 'settings' => array('image_style' => 'thumbnail')))));
And it show me this:
<div class="field field-name-field-marker field-type-image field-label-hidden"><div class="field-items"><div class="field-item even"><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="" /></div></div></div>
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.