API to display block in regions I would like to display blocks in region by code, in the same way that I can use context (so: if I'm on a node_view of type "article" display block "user login" on region "Sidebar first", for example).

I know how to load and display blocks but I don't know which is the best place to make it.

Have I to add the render function in regions template?
Or have I to use a theme function to do this?
Instead of using the admin blocks interface, if you really want to manually render blocks, you can render:

Directly in a template: 

if ($block = module_invoke('module_name', 'block_view', 'block_delta')) {
  print render($block['content']); 
}


Via code, with drupal_add_region_content

if ($block = module_invoke('module_name', 'block_view', 'block_delta')) {
  drupal_add_region_content('left',  $block['content']);
}