I've created a simple gallery in Drupal using a custom content type. It's really just an article with an image field that can have an unlimited number of items. I've created a custom template for this content type (node--gallery.tpl.php) and for the full page I'm satisfied with the look and feel.
The one thing I'm stuck on is displaying only the first few images in the teaser. I want to display just the first row of images in the teaser (that first 3 images). In the template file, $content['field_images']
contains all the images for the gallery but print render($content['field_images']
outputs all the images (as I would expect).
So, how do I get Drupal to just output the first three items from $content['field_images']
? An improvement I would be interested in is how would I get Drupal to output 3 random images although if I know how to cut down the number of images rendered I'm confident I can work that one out myself.
<img>
tags? Or is it an array? – mario