You are here

function hook_define_regions in Regions 7

Same name and namespace in other branches
  1. 6 regions.api.php \hook_define_regions()

Hook allowing modules to define regions.

Return value

An array of regions, keyed by region, containing:

  • title: the region title
  • css: optional path to stylesheet for theming the new region, relative to implementing module directory.
  • js: optional path to javascript file, relative to implementing module directory.
  • render_callback: optional function to use in rendering blocks of this region (will be passed 'block' and $block parameters).
3 functions implement hook_define_regions()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

regions_admin_left_define_regions in modules/regions_admin_left/regions_admin_left.module
Implements hook_define_region().
regions_right_slideout_define_regions in modules/regions_right_slideout/regions_right_slideout.module
Implementation of hook_define_region().
regions_top_nav_define_regions in modules/regions_top_nav/regions_top_nav.module
Implements hook_define_region().
2 invocations of hook_define_regions()
regions_system_info_alter in ./regions.module
Implements hook_system_info_alter().
_regions_list in ./regions.module
Helper function lists defined regions against theme regions.

File

./regions.api.php, line 20
Hooks provided by Regions.

Code

function hook_define_regions() {
  return array(
    'myregion1' => array(
      'title' => 'My region 1',
      'css' => drupal_get_path('module', 'mymodule') . '/css/style.css',
      'js' => drupal_get_path('module', 'mymodule') . '/js/script.js',
      'render_callback' => 'mymodule_callback',
    ),
    'myregion2' => array(
      'title' => 'My region 2',
    ),
  );
}