Skip to main content
added 257 characters in body
Source Link
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54

Since you are rendering a field , you can use below code

<?php
$image = field_get_items('node', $node, 'field_history_image');
$output = field_view_value('node', $node, 'field_history_image', $image[0]);
print render($output);
?>

OR

$view = field_view_field('node', $node, 'field_image''field_history_image');
print render($view);

Since you are rendering a field , you can use below code

<?php
$image = field_get_items('node', $node, 'field_history_image');
$output = field_view_value('node', $node, 'field_history_image', $image[0]);
print render($output);
?>

OR

$view = field_view_field('node', $node, 'field_image');
print render($view);

Since you are rendering a field , you can use below code

<?php
$image = field_get_items('node', $node, 'field_history_image');
$output = field_view_value('node', $node, 'field_history_image', $image[0]);
print render($output);
?>

OR

$view = field_view_field('node', $node, 'field_history_image');
print render($view);
added 257 characters in body
Source Link
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54

You need to useSince you are rendering a field theme_image api function to display image provided URI...

For Example, you can use below code

print theme_image(<?php
      $image = arrayfield_get_items('path' =>'node', $node->field_history_image['und'][0]['uri'], 'field_history_image');
            $output = 'attributes'field_view_value('node', =>$node, array('class''field_history_image', =>$image[0]);
print arrayrender('myclass')$output),;
              'alt' => 'YOUR ALT',?>
              'title' =>

OR

$view 'YOUR= TITLE'field_view_field('node',
            $node, 'field_image');
      print render($view);

You need to use theme_image api function to display image provided URI...

For Example

print theme_image(
        array('path' => $node->field_history_image['und'][0]['uri'], 
              'attributes' => array('class' => array('myclass')),
              'alt' => 'YOUR ALT',
              'title' => 'YOUR TITLE',
             )
       );

Since you are rendering a field , you can use below code

<?php
$image = field_get_items('node', $node, 'field_history_image');
$output = field_view_value('node', $node, 'field_history_image', $image[0]);
print render($output);
?>

OR

$view = field_view_field('node', $node, 'field_image');
print render($view);
Source Link
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54

You need to use theme_image api function to display image provided URI...

For Example

print theme_image(
        array('path' => $node->field_history_image['und'][0]['uri'], 
              'attributes' => array('class' => array('myclass')),
              'alt' => 'YOUR ALT',
              'title' => 'YOUR TITLE',
             )
       );