Skip to content

Instantly share code, notes, and snippets.

@mynameispj
Created June 14, 2013 12:31
Show Gist options
  • Save mynameispj/5781449 to your computer and use it in GitHub Desktop.
Save mynameispj/5781449 to your computer and use it in GitHub Desktop.
Drupal 7, print images from a node
$person = node_load($person_nid);
$image = field_get_items('node', $person, 'field_image');
foreach ($image as $key=>$value) {
$output = field_view_value('node', $person, 'field_image', $image[$key], array(
'type' => 'image',
'settings' => array(
'image_style' => 'thumbnail', //place your image style here
'image_link' => 'content',
),
));
print render($output);
}
// http://www.wootenswebdesign.com/loop-through-multiple-image-fields-drupal-7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment