Skip to content

Instantly share code, notes, and snippets.

@brianberlin
Forked from berkes/views-view-grid.tpl.php
Created June 26, 2012 17:34
Show Gist options
  • Save brianberlin/2997297 to your computer and use it in GitHub Desktop.
Save brianberlin/2997297 to your computer and use it in GitHub Desktop.
Drupal grid view template for omega theme.
<?php
/**
* @file views-view-grid.tpl.php
* Default simple view template to display a rows in a grid.
*
* - $rows contains a nested array of rows. Each row contains an array of
* columns.
*
* @ingroup views_templates
*/
?>
<?php if (!empty($title)) : ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $columns): ?>
<div class="grid-12 alpha omega views-row">
<?php foreach ($columns as $counter => $item): ?>
<?php
if ($counter == 0) {
$alpha_omega = ' alpha';
}
elseif (count($columns) == ($counter + 1)) {
$alpha_omega = ' omega';
}
else {
$alpha_omega = '';
}
?>
<div class="views-column grid-<?php print 12 / count($columns) . $alpha_omega ?>">
<?php print $item; ?>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment