I have a set of four content blocks that I show in the right sidebar column of almost every page. I have been maintaining the block settings by setting visibility to "Show on every page except the listed pages." and adding the individual pages in each of the four blocks when I don't want them displayed on a page.
I'm wondering, can I insert some PHP code into my individual nodes that control the visibility of the blocks. So I could set the blocks to "Show if the following PHP code returns TRUE (PHP-mode, experts only)." and have the php code be something like
<?php if ( $hide_main_blocks ) return FALSE; else return TRUE; ?>
Then insert code into my individual nodes when I want to hide the blocks on that page.
<?php $hide_main_blocks = true; ?>
I tried this and it doesn't seem to work. The blocks don't know anything about the $hide_main_blocks variable. Is there a way to get the blocks to be aware of my setting for that value?