How to render a node image separately from the rest of the node content I want to know the variable name for the image which renders with content; being more specific when I render my content with the following code:

&lt;?php
  print render($content);
?&gt;


It renders my node image, title, body, and tags. I want to put a &lt;div&gt; around my image, but I don't know how to specifically do it in my node.tpl.php. I found out how to render my tags, but I have no luck with images.
What you need is the machine name for your field. This can be found by browsing to the content type in the admin, and seeing the value in the machine name column in the table. Within your node.tpl.php you can then access it using:

 print render($content['field_machine_name']);


By way of a more comprehensive description of how to render different elements of your node within the node.tpl.php, please see the rest of this answer.

You can implement this in a corresponding node template for your theme: In your theme directory, copy the default node.tpl.php from Drupal itself (resides in root_directory/modules/node/node.tpl.php, then make a second copy, node--content_machine_name.tpl.php. The variable you're interested in is an array which contains all the contents of the node you're about to display (from the Drupal API docs):


  $content: An array of node items. Use render($content) to print them
  all, or print a subset such as render($content['field_example']).


Using the $content array within this template then allows you to print either sections of the array (field by field for example), or to print the whole array, or to hide sections in the print of the whole array to display later.

By way of a couple of examples:

To print a specific field output:

&lt;div class="example_field"&gt;
    &lt;?php print render($content['field_name']); ?&gt;
&lt;/div&gt;


Or to delay the printing of a field until after you've printed the rest of the content. (This is used in the default node.tpl.php to print comments after the article content .

&lt;?php
    // Don't print the comments during the main content run
    hide($content['comments']);

    // Render the main content array
    print render($content);

    // Then render the comments last
    print render($content['comments']);
?&gt;


Which will print the field after the main content block. For more information check out the node.tpl.php docs.