Skip to Content

node.tpl.php

creating a node.tpl.php file

| | |

node.tpl.php in box_grey

We looked at page.tpl.php in box_grey which is a great, simple theme. It does have some limitations though:

  • Tables are still used for visual Layout
  • Structural tags are used strictly for clearing: <br class="clear" />
  • Some static title and alt values are explicitly set

The default node.tpl.php mark-up on the other hand is quite usable. It's not nearly as complex as far as structure goes because it does not require any mark-up for layout. It is just the content after all:

node.tpl.php Variables

| | |

You can use the variables on this page to print out dynamic content in your node.tpl.php document.

The following list and descriptions are from Drupal.org

View the PHP syntax used to apply these variable to your *.tpl.php file.

$title
Title of node.
$node_url
Link to node.
$terms
HTML for taxonomy terms.

node.tpl.php Overview

| | |

Here's the official word from Drupal.org on node.tpl.php:

This template controls the display of a node, and a node summary.

View the Overview of node.tpl.php at Drupal.org

Node?

No really, what is a node? A node is an individual piece of content, so a blog post, a book page, a forum entry and an original CCK type entry are all nodes. So node.tpl.php is the template file that controls the display of nodes*.

Syndicate content