Skip to content

Instantly share code, notes, and snippets.

@drupalalsur
Created January 21, 2012 21:53
Show Gist options
  • Save drupalalsur/1654188 to your computer and use it in GitHub Desktop.
Save drupalalsur/1654188 to your computer and use it in GitHub Desktop.
Personalización de la galería
<?php
$columns = 5;
$rows = array_chunk($items, $columns);
?>
<table class="mini-gallery">
<tbody>
<?php foreach ($rows as $row_number => $columns): ?>
<?php
$row_class = 'row-' . ($row_number + 1);
if ($row_number == 0) {
$row_class .= ' row-first';
}
if (count($rows) == ($row_number + 1)) {
$row_class .= ' row-last';
}
?>
<tr class="<?php print $row_class; ?>">
<?php foreach ($columns as $column_number => $item): ?>
<td class="<?php print 'col-'. ($column_number + 1); ?>">
<div class="photo-image"><?php print render($item); ?></div>
<div class="photo-title"><?php print($item['#item']['title']); ?>
<div>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment