I'm working on a Drupal 6 site made by other people, and I need to remove some block on the homepage for my language only.
I'm trying to use a Context and, by use of hook_context_init()
, check if the context is active and remove the undesired blocks.
But i have a problem: How can I remove block in a hook function?
I hope my question is clear.
I don't want to hide the blocks with CSS because of the dirty markup..
[RESOLVED] I did a preprocess like:
function wfp_homepage_context_preprocess_block(&$vars, $hook) {
$to_delete = array('block_delta_1', 'block_delta_2')
if(in_array($vars['block']->delta , $to_delete)){
$vars['template_files'][0] = 'block-empty';
}
}
and i add an empty block-empty.tpl.php in my theme.