I am trying to create an image gallery, using Views 3 for Drupal 7. A brief overview of what I did:
- Create custom content type for photo gallery (title and image fields
- Create View for the gallery page
- Set format to "Grid", and show to "Fields" - Added field: "Content: Photo" (preview image style) - Added field: "Content: Photo" (thumbnail image style)
As you can see, I have two fields with the same field so that I can have two differently sizes of each image. What I need to do, is print these images in two different places in my template.
This is my
<table> <?php foreach ($rows as $row_number => $columns): ?> <tr> <?php foreach ($columns as $column_number => $item): ?> <td> <?php print $item; ?> </td> <?php endforeach; ?> </tr> <?php endforeach; ?> </table>
I want to be able to do something like this:
<table> <tr> <?php // foreach ?> <td> <?php // print preview image ?> </td> </tr> </table> <div class="thumbnails"> <?php // foreach ?> <?php // print thumbnail image ?> </div>
I have tried a multitude of things, but I can only make
$item print either one of the images, or both of the images. Since only the final, HTML-formatted image is returned, I can't figure out how it is possible to split it up.
Thanks much in advance!