So basically i want to add a link to original node around each row in views. I have added the following code to the style and row template override in views. Both come up with the same result.
<?php $image = file_create_url($row->field_field_display_image[0]['rendered']['#item']['uri']); ?>
<a href="www.google.com"/>
<div class="block__inner" style="background-image: url('<?php echo $image; ?>');">
<?php foreach ($fields as $id => $field): ?>
<?php if (!empty($field->separator)): ?>
<?php print $field->separator; ?>
<?php endif; ?>
</div>
</a>
Now the issue that i am having is that the link is added to each field element that is outputted for some reason, and not just the link around the whole row and each field.
I cannot use custom field as that is making the same issue. It seems views is auto closing the a tag.
Any known workarounds?
display: block
anchor is a perfectly valid wrapper element imho.