What's a tidy way for a node to disable blocks or regions?
Looking for inspiration...
Some (but not all) of my nodes and views don't fit too well into a 3-col layout. I'm planning the option to drop off the right column in cases where my content is too wide to be comfortable - large video and image nodes to begin with.
I see that a few modules have figured how to not show any blocks at all (eg devel: variables)
<?php
function devel_variable_page() {
// we print our own page so as to avoid blocks
$output = drupal_get_form('devel_variable');
print theme('page', $output, FALSE);
}
?>but that's too early in the process.
I see that the section.module helps me switch themes and styles, but that's overkill, and would be a pain to maintain.
Currently, I've crammed the logic into the block visibility settings - for each individual block that may appear on the right col. I have to use php code, as the list of paths etc is already unwieldy.
<?php
/**
* Logic to decide whether the current page should show the right column.
* Abstracted here for easy access from the block visibility php code.
*
* @return bool
*/
function show_rightcol() {
if( arg(0) == 'taxonomy') {return TRUE;}
if(
(arg(0) == 'node')
&&
(is_numeric(arg(1)))
&&
($node = node_load(arg(1)))
) {
return in_array($node->type, array('page', 'story', 'product'));
}
return FALSE;
}
?>Currently only show sidebar on some actual content pages and taxonomy pages, not other content types or special pages
And that's looking messy.
I was hoping to be able to disable an entire region conditionally in one of the theme processes depending on context information. Still not sure what that context info is, the logic for these requirements is admittedly under development.
Anybody have any inspiration about how I can just flag "Don't show the right col on this page" in a tidy way? Surely there's one of the theme hooks that can let me clear it.
I'm not too worried about it being built and unset later, although a "don't build these blocks" solution would be good too.

I haven't tried in a while
I haven't tried in a while but it can be done fairly reliably by overriding theme_blocks –plural.
Set a flag early then use that to filter the region calls. The node rendering is done very early before rendering block regions. I would stick with consistent node types that you know would feel the squeeze to prevent the region from returning. With views, I'm not sure but there should be a way.
Here's an example from my neglected theme. It was done more as an experiment but this function does the filtering for different reasons.
http://si-lumen.us/api/function/phptemplate_blocks/lumen