function hook_define_regions in Regions 6
Same name and namespace in other branches
- 7 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).
2 invocations of hook_define_regions()
- regions_system_info_alter in ./
regions.module - Implementation of hook_system_info_alter().
- _regions_list in ./
regions.module - Helper function lists newly defined regions against regions already declared by a theme.
File
- ./
regions.api.php, line 21 - 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',
),
);
}