0
votes

Goal : To add a div wrapper for the fields so as to group the fields per result.

So views is displaying all the results as fields and I need to theme it as per each result. So each result will have the name, image ....

You can see the current results view here : http://www.iamvishal.com/dev/prosearch/%20/%20/%20/%20/%20

I tried to theme it using views-view-unformatted.tpl.php file but It won't do anything. I did change the tpl to suit my view such as views-view-unformatted--properityresults--page.tpl.php.

It won't work. Any clues what is going wrong ?

Below is the code:

<?php if (!empty($title)): ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>

<?php foreach ($rows as $id => $row): ?>
<div class="<?php print $classes_array[$id]; ?>">
<?php print $row; ?>
</div>

<?php endforeach; ?>
1
Just to check, is your view definitely called properityresults and not propertyresults (without the i)? Also did you clear Drupal's caches once you'd added the new template file? - Clive
hi clive its with the i. I managed to fix this I will post the answer soon. Thanks - Vishal Khialani

1 Answers

0
votes

The correct template file was views-view--properityresults--page.tpl.php

and not views-view-unformatted--properityresults--page.tpl.php.

cheers, Vishal

I will mark is solved after a day as per the system settings.