views-view-grid.tpl.php 894 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. reset($rows);
  3. $gridsize = count($rows[0]);
  4. ?>
  5. <?php if (!empty($title)) : ?>
  6. <h3 class="grid-title"><?php print $title; ?></h3>
  7. <?php endif; ?>
  8. <table class="views-view-grid grid-<?php print $gridsize ?>">
  9. <tbody>
  10. <?php foreach ($rows as $row_number => $columns): ?>
  11. <?php
  12. $row_class = 'row-' . ($row_number + 1);
  13. if ($row_number == 0 && count($rows) > 1) {
  14. $row_class .= ' row-first';
  15. }
  16. elseif (count($rows) == ($row_number + 1)) {
  17. $row_class .= ' row-last';
  18. }
  19. ?>
  20. <tr class="<?php print $row_class; ?>">
  21. <?php foreach ($columns as $column_number => $item): ?>
  22. <td class="<?php print 'col-'. ($column_number + 1); ?>">
  23. <div class="grid-item"><?php print $item; ?></div>
  24. </td>
  25. <?php endforeach; ?>
  26. </tr>
  27. <?php endforeach; ?>
  28. </tbody>
  29. </table>