Show a block on specific content types

July 15, 2011

Drupal 7 has this feature in the UI, but for Drupal 6 I keep going back to this post on FreshBlurbs- I really should remember it by now. Anyway, here’s a slightly amended version that I prefer.

<?php
$nodetypes = array('workstream', 'event');
if (arg(0) == 'node' && ctype_digit(arg(1))) {
  $node = node_load(arg(1));
  return in_array($node->type, $nodetypes);
}
?>

Tags