custom view template to all the fields

Comments Default Code

<!–<?php foreach ($fields as $id => $field): ?>
<?php if (!empty($field->separator)): ?>
<?php print $field->separator; ?>
<?php endif; ?>

<?php //print $field->wrapper_prefix; ?>
<?php print $field->label_html; ?>
<?php //print $row->field_field_image[0][‘raw’][‘uri’]; ?>
<?php print $field->content; ?>
<?php //print $field->wrapper_suffix; ?>

<?php endforeach; ?>–>

Placed Your Code

<div class=”featuredblock” style=”background:url(‘<?php echo ‘/sites/default/files/’.file_uri_target($row->field_field_image[0][‘raw’][‘uri’]); ?>’)”>
<?php print $fields[‘title’]->content; ?>
<?php print $fields[‘body’]->content; ?>
</div>

Advertisements