Optionally theming a node
Task · theme a specific node type · theme nodesIA · Themers · Drupal 4.5.x or older · Drupal 4.6.x · Drupal 4.7.x
Last modified: August 26, 2009 - 23:31
If you want to sometimes theme a certain type of node, but other times want to just let the default node theme apply, you can use this (slightly black magic) snippet in your node-type.tpl.php
<?php if ($node->do_special_handling) { ?>
// custom theming goes here
<?php } else {
print _phptemplate_callback('node', compact('node', 'title', 'content', 'links', 'page', 'submitted', 'picture', 'terms', 'sticky', 'node_url', 'name', 'date', 'taxonomy', 'main'));
} ?>