I was trying to edit my view theme with php in the file views-view-field--homepage-banner--block--field-site-image.tpl.php and try to print view fields, but values come's empty. any ideas?

Code example:

$link2 = '/' . strip_tags($fields['field_site_image_link']->content);
print $src;
print $link2;
<a href="<?php echo $fields['field_site_image_link']->content; ?>"><?php echo $fields['field_site_image']->content; ?></a>

1 Answer 1


1- clear cache
2- take the views-view-field.tpl.php source as a starting point for doing what you need also have a look at documentation at the top of the file

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.