block
Enable block
There is no available API to programmatically set a block. Like Drupal core does, we have to use db directly.
Programmaticaly insert block
to output a block created by a module in code, use:
Embed a mini panel
Get the html output of a mini-panel
Simple block definition
Define and set content into a block. See hook_block_configure and hook_block_save if you want people be able to choose options.