I have modified the tpl used for the grid view to show 3 columns of content, my only issue that the code below creates unneeded divs for the view. I have a maximum of 9 items that should be output in 3 rows, 3 per column. What’s the best way to modify the code below? to prevent the extra divs from being output.
<?php foreach ($rows as $row_number => $columns): ?>
<div>
<?php foreach ($columns as $column_number => $item): ?>
<?php print $item; ?>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
I would drop that notation of foreach syntax (but I think that’s pretty personal 🙂 )
You could use the modulo to check if you just had 3 columns (if I understood your question).
I’ve also dropped all those opening and closing tags of php for readability.