Created
January 21, 2012 21:53
-
-
Save drupalalsur/1654188 to your computer and use it in GitHub Desktop.
Personalización de la galería
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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