Drupal: Display Block Only For a Specific Node Type
On the block configuration page, in the “page-specific visibility settings”, enable option three: “Show if the following PHP code returns TRUE (PHP-mode, experts only).” and enter the following code:
<?php
$bresval = false;
if (arg(0) == 'node' && ctype_digit(arg(1))) {
$node = node_load(arg(1));
if ($node->type == 'event') {
$bresval = true;
}
}
return $bresval;
?>
In this particular case, we will only display the block if node type is “event”.