Showing block content based upon page categories

If you are trying to display content in your blocks based upon what categories your page belongs to, head over here.  Good article on how to do this.

 

One thing, the code he used is an image, so here is a text version of it for the argument

$node = node_load(arg(1)); 
if ($node && $node->taxonomy) {
foreach($node->taxonomy as $term) {$terms[] = $term->tid;} return implode('+' , $terms);
} else {
return;
}

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options