Inserire immagini multiple con Colorbox in Drupal7

1 contenuto / 0 new
Inserire immagini multiple con Colorbox in Drupal7

Ciao a tutti,
vorrei inserire delle immagini multiple in un nodo con Colorbox, in Drupal 7.

Ho seguito passo passo questo tutorial
http://www.mariohifi.eu/drupal/colorbox-images-gallery

Funziona tutto correttamente solo che le immagini non si dispongono in righe da 5 colonne, ma una sotto l'altra.

Vi riporto anche il codice del template che ho usato (file rinominato: field--field_colorbox.tpl.php).

<?php
/*template - drupal.org/node/1224106#comment-4969404
Photo title - drupal.org/node/432846#comment-4125056
used at: <a href="http://www.highrockphoto.com
/*
/*" rel="nofollow">www.highrockphoto.com
/*
/*</a> change the column count to the number of photos you want to appear going across. (Adjust thumbnail size as needed) */
$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>

Cosa sbaglio?

Qualcuno sa aiutarmi?

Grazie mille!

Drupal Version: