block visibility

Block visibility based on taxonomy term

If you want a particular block, to only show on pages with a specific taxonomy term, drop this snippet into the block visibility field


if ((arg(0) == 'node')) {
$node = node_load(arg(1));
foreach ($node->taxonomy AS $vocab) {
if($vocab->tid == 185){
return true;
}
}
}
return false;

Of course, they're are much more elegant ways to handle this using views/arguments

Syndicate content