Programmatically Set Node Type Visibility for Blocks
March 15, 2013
If you've ever created a block with hook_block_info you know that the visibility options are limited to just pages. In my case, I wanted to set my block to only appear on certain node types. The challenge is that you can't do it from hook_block_info because node type visibility isn't dictated by the block module, it's provided by the node module.
But fear not, there is a way! If you want to add content type based visibility for your block, you can do so in the .install file of your module using hook_install.