You are here

function hook_regions_region_alter in Regions 7

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

Hook allowing other modules to alter the region array.

This happens before the each element is concatenated into a string.

Parameters

array $region: A keyed array of region HTML elements and strings, containing:

  • start: the region DIV with the $region_name as ID and 'regions' CLASS.
  • blocks: a string containing the themed blocks for this region, as returned by theme_block().
  • end: a closing DIV.

string $region_name: machine name of the region being passed.

See also

regions_footer()

hook_regions_blocks_alter()

3 functions implement hook_regions_region_alter()

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_regions_region_alter in modules/regions_admin_left/regions_admin_left.module
Implements hook_regions_region_alter().
regions_right_slideout_regions_region_alter in modules/regions_right_slideout/regions_right_slideout.module
Implementation of hook_regions_region_alter().
regions_top_nav_regions_region_alter in modules/regions_top_nav/regions_top_nav.module
Implements hook_regions_region_alter().
1 invocation of hook_regions_region_alter()
regions_page_alter in ./regions.module
Implements hook_page_alter().

File

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

Code

function hook_regions_region_alter(&$region, $region_name) {

  // Example to add an inner DIV to the region markup.
  $new_markup = array(
    'start' => $region['start'],
    'inner' => '<div id="' . $region_name . '-inner">',
    'blocks' => $region['blocks'],
    'inner_end' => '</div>',
    'end' => $region['end'],
  );
  $region = $new_markup;
}