* Most modules do not provide an initial value, and any value provided can
* be modified by a user on the block configuration screen.
* - 'status': (optional) Initial value for block enabled status. (1 =
- * enabled, 0 = disabled). Most modules do not provide an initial value,
- * and any value provided can be modified by a user on the block
- * configuration screen.
+ * enabled, 0 = disabled). An initial value for 'region' is required for
+ * 'status' to take effect.
+ * Most modules do not provide an initial value, and any value provided can
+ * be modified by a user on the block configuration screen.
* - 'region': (optional) Initial value for theme region within which this
- * block is set. Most modules do not provide an initial value, and
- * any value provided can be modified by a user on the block configuration
- * screen. Note: If you set a region that isn't available in the currently
- * enabled theme, the block will be disabled.
+ * block is set. If the specified region is not available in a theme, the
+ * block will be disabled. The initial value for 'status' must be enabled or
+ * the initial region value is ignored.
+ * Most modules do not provide an initial value, and any value provided can
+ * be modified by a user on the block configuration screen.
* - 'visibility': (optional) Initial value for the visibility flag, which
* tells how to interpret the 'pages' value. Possible values are:
* - BLOCK_VISIBILITY_NOTLISTED: Show on all pages except listed pages.
function system_block_info() {
$blocks['main'] = array(
'info' => t('Main page content'),
- // Cached elsewhere.
+ // Cached elsewhere.
'cache' => DRUPAL_NO_CACHE,
+ // Auto-enable in 'content' region by default, which always exists.
+ // @see system_themes_page(), drupal_render_page()
+ 'region' => 'content',
+ 'status' => 1,
);
$blocks['powered-by'] = array(
'info' => t('Powered by Drupal'),
'info' => t('System help'),
'weight' => '5',
'cache' => DRUPAL_NO_CACHE,
+ // Auto-enable in 'help' region by default, if the theme defines one.
+ 'region' => 'help',
+ 'status' => 1,
);
// System-defined menu blocks.
foreach (menu_list_system_menus() as $menu_name => $title) {