Created
April 28, 2010 18:47
-
-
Save zerolab/382534 to your computer and use it in GitHub Desktop.
Drupal 5 - Show block if a node has a specific taxonomy term
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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