Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChrisLTD/918809 to your computer and use it in GitHub Desktop.
Save ChrisLTD/918809 to your computer and use it in GitHub Desktop.
Show block on Taxonomy term listings if it is inside a particular vocabular
<?php
// Show block on Taxonomy term listings
$make_block_visible = FALSE;
$vocab_id_to_trigger_show_block = 8;
if ((arg(0) == 'taxonomy') && (arg(1) == 'term')) {
$term_obj = taxonomy_get_term(arg(2));
$vocab_id = $term_obj->vid;
if($vocab_id == $vocab_id_to_trigger_show_block){
$make_block_visible = TRUE;
}
}
return $make_block_visible;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment