Controlling block page display options programatically

Apr
2015
06

You can set the region, the weight and the path of custom block in a custom module like this:

function hook_block_info(){
    $blocks = array();
    $blocks['my_custom_block'] = array(
        'info' => t('Custom Block Options'),
        'status' => TRUE,
        'theme' => 'MY_THEME',
        'region' => 'MY_REGION',
        'weight' => 0,
        'visibility' => BLOCK_VISIBILITY_LISTED,
        'pages' => "aboutus/*",
        'custom' => FALSE
    );

    return $blocks;
}

You can find the theme / region settings-options at your sites/all/themes folder usually in the theme.info file
More details here: https://api.drupal.org/api/drupal/modules!block!block.api.php/function/h...

this is an arrow pointing back to the top of the page