Skip to content

Instantly share code, notes, and snippets.

@zerolab
Created April 28, 2010 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerolab/382534 to your computer and use it in GitHub Desktop.
Save zerolab/382534 to your computer and use it in GitHub Desktop.
Drupal 5 - Show block if a node has a specific taxonomy term
<?php
// Drupal 5
// Show block if a node has a specific taxonomy term
$show_block = FALSE;
if ( arg(0) == "node" && is_numeric(arg(1)) ) {
$node = node_load(arg(1));
$section_term_id = 1334; // replace this to the corresponding term id
$show_block = ( is_array($node->taxonomy) && in_array($section_term_id, array_keys($node->taxonomy)) );
}
return $show_block;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment