Hide a block depending on the value of a field? I have put a block in the taxonomy pages.
I have added a new field to the vocabulary with two states: shown, hidden.
I want that when in taxonomy term I select hidden, the block to be hidden.


So I can display or not a block depending on the categories.

I've tried with this code in the block visibility options,  but it does not works:

global $field_show_block;
return ($field_show_block == "show");


Any ideas?
Can it be done with Views?

Thank You
As Letharion points out you can use Panels to do this, but panels does indeed have a bit of a steep learning curve. It might be quicker to learn something like the Context Module with Context Entity Field.

To do this with context, create a new context with whatever name you like. Then in the Conditions area add the "Entity field" as a condition and select entity type as taxonomy term. Then select the field you created in your vocabulary e.g. "field_show_block" and uncheck the "empty field" checkbox and put in "show" into the field value. Then in Reactions select which blocks you want to show, and assign them to the relevant regions.

If you don't want to do things using a Drupal contributed module though, the following visibility code (with the core PHP filter module on) may work with a bit of tweaking to match your exact field name:

&lt;?php
// assumes the user is visiting taxonomy/term/&lt;tid&gt;
if (arg(0) == 'taxonomy' &amp;&amp; arg(1) == 'term' &amp;&amp; is_numeric(arg(2))) {
  $term = taxonomy_term_load(arg(2));
  if (isset($term-&gt;field_show_block[LANGUAGE_NONE][0]['value'])) {
    return $term-&gt;field_show_block[LANGUAGE_NONE][0]['value'] == "show"; 
  }
}
return FALSE;
?&gt;


The reason why using the PHP filter for block visibility is bad practice is because, when the PHP code is written incorrectly, it's a little awkward to fix it (e.g. clearing database columns). It's also a potential security risk, allowing database stored PHP code to be executed unchecked.