Note: To do this in Drupal 7 please see Drupal 7 Template Suggestions.
The file node.tpl.php is used to theme certain types of nodes. This single file generically covers all Content Types and you can edit it to make changes across the board as detailed on the node.tpl.php handbook page. To theme individual content types in different ways, you need to create a file
node-[type].tpl.php in your theme's folder, where
[type] is the machine readable name of the content type, for each type you wish to theme. Some examples:
- Themes only Story type nodes.
- Themes only Page type nodes. Note that this is different from page.tpl.php which controls the layout of the entire page including header, sidebars and so on.
- Themes only Forum type nodes.
- Themes only Book type nodes.
In general, you can replace [type] with any content type system name. One exception is the Flexinode module, which uses numbers to name the types. See Node Templates for Flexinode Content Types. Note that you cannot use node-admin.tpl.php to theme just the admin pages—but you can use page-admin.tpl.php to theme the admin "pages".
Once you have this new file, copy in the contents of node.tpl.php and modify it however you wish. All the variables listed on node.tpl.php can be used.
NOTE: When using phptemplate node-[type].tpl.php suggestions, there must also be an original node.tpl.php template present in your theme directory or the template suggestion is ignored.
This is also the case for subthemes. Just copy the parent themes node.tpl.php into your subtheme folder and refresh the theme cache.
More details can be found at the Core templates and suggestions handbook page.
For more information on theming nodes by content type in Drupal 6, please refer to the following handbook pages: