Question

Can we programmatically set the value of a block in drupal?? We could do that via the admin section, but I am looking to see if there is a way, where we could programmatically say that

if($block=="sidebar") {
// do this
}

I could then put this in a preprocess node hook or in a block hook.

Was it helpful?

Solution

Have you tried using hook_block() and setting ($op = "view") ?!

More info here: http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/hook_block/6

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top