tags:

views:

18

answers:

2

Hey everyone,

In Drupal 6, I would do the following to get images in my node--articles.tpl.php page:

<?php
$cck_images = $node->field_image;

if (count($cck_images)>0) :
    foreach ($cck_images as $cck_image) :
        $image = theme('imagecache', 'large', $cck_image['filepath'], $cck_image['data']['alt'], $cck_image['data']['title']);
        print $image;
    endforeach;
endif;
?>

However, in Drupal 7 there is not a '['filepath']', I have tried using:

<?php print_r($field_image); ?>

But the variable is not there. I know Drupal 7 is still in alpha, but any help would be greatly appreciated!

A: 

I would also like to know the answer to this question.

Gary Watson
+1  A: 

found it, try this

<?php
$nid = 4; 
$node = node_load($nid);
?>
<img src="<?php echo render(file_create_url($node->field_image['und'][0]['uri'])); ?>" />
Gary Watson