I'm building up a custom module which contains a few blocks. These blocks will always only appear either on the front page or on every other page, mutually exclusive.

I'd like to be able to pre-configure these blocks on install, but I'm not sure how to go about it. The documentation for hook_block_configure mentions an '#options' key, but has no details on the format of that info.

Can anyone get me pointed in the right direction here?


If you want to set the standard block options, you can do that in hook_block_info


 * Implements hook_block_info
function MODULE_block_info() {

  $blocks = array();

  // Assign block to front page, sidebar_first region by default
  $blocks['my_front_page_block'] = array(
    'info' => t('Front page block'),
    'status' => 1,
    'region' => 'sidebar_first',
    'visibility' => BLOCK_VISIBILITY_LISTED,
    'pages' => '<front>'

  return $blocks;

| improve this answer | |
  • 1
    I somehow missed that in the docs. My head is swimming learning Drupal, but its a pretty cool framework. Thanks! – Noah Duncan May 16 '14 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.