1

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:

<?php
$link=$fields['field_site_image_link']->content;
$src=$fields['field_site_image']->content;
$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>
0

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

| improve this answer | |

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.