node.tpl.php

Same filename in this branch
  1. 7.x themes/bartik/templates/node.tpl.php
  2. 7.x modules/node/node.tpl.php
2 theme calls to node.tpl.php
node_view in modules/node/node.module
Generates an array for rendering the given node.
ThemeDebugMarkupTestCase::testDebugOutput in modules/simpletest/tests/theme.test
Tests debug markup added to template output.

File

themes/garland/node.tpl.php

View source
<div id="node-<?php

print $node->nid;
?>" class="<?php

print $classes;
?>"<?php

print $attributes;
?>>

  <?php

print $user_picture;
?>

  <?php

print render($title_prefix);
?>
  <?php

if (!$page) {
    ?>
    <h2<?php

    print $title_attributes;
    ?>><a href="<?php

    print $node_url;
    ?>"><?php

    print $title;
    ?></a></h2>
  <?php

}
?>
  <?php

print render($title_suffix);
?>

  <?php

if ($display_submitted) {
    ?>
    <span class="submitted"><?php

    print $submitted;
    ?></span>
  <?php

}
?>

  <div class="content clearfix"<?php

print $content_attributes;
?>>
    <?php

// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
print render($content);
?>
  </div>

  <div class="clearfix">
    <?php

if (!empty($content['links'])) {
    ?>
      <div class="links"><?php

    print render($content['links']);
    ?></div>
    <?php

}
?>

    <?php

print render($content['comments']);
?>
  </div>

</div>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.