I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help.
First please see the screenshot:
Below is what I want to achieve:
WHITE boxes are laid out as float: left;
I want A, B and C to shift below their respective titles, i.e. at A1, B1 and C1 spots respectively.
I want to make the TITLE + A1 to be under the same container so the container can float left itself. Same with TITLE + B1 and TITLE + C1
I copied views-view-unformatted.tpl.php file to my custom theme folder. The code snippet is rendering the data fine:
<?php foreach ($rows as $id => $row): ?>
<div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"'; } ?>>
<?php print $row ?>
</div>
<?php endforeach; ?>
But I want each of the field in $row
to be printed in a way I want, e.g.:
<?php foreach ($rows as $id => $row): ?>
<div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"'; } ?>>
<div class="image-class"><img src="" /></div>
<div class="text-class">
<?php print $row->title ?><br />
<?php print $row->body ?>
</div>
</div>
<?php endforeach; ?>
I believe there is a way to do it but don't know how. $row->title
or $row->body
is actually printing (rendering) nothing.
Also, if I modify views-view-unformatted-tpl.php it will affect the entire site. So I want a separate view for this purpose. How to do this?
views-view-unformatted.tpl.php
because it will affect all unformatted views. What you need to do, is add your view name so it only affects that specific view. views-view-unformatted--[view-name].tpl.php