I'm trying to print the image field from a node using the nid in the url.
$nid = $_GET['field_item_request'];
Is there a specific way to do this?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
I needed to add a specific style to my image. So I modify the code above to fit my needs. Hopefully it will help somebody out.
$nid = $_GET['field_item_request']; $node = node_load($nid); $image = field_get_items('node', $node, 'field_image'); $image_output = render(field_view_value('node', $node, 'field_image', $image, array('settings' => array('image_style' => 'medium', 'label' => '')))); print render($image_output);