Screencast of how to use this module
Regions in Drupal are defined by the theme layer. This is problematic in instances where you want to add blocks / boxes to a specific region that is theme independent. Some examples of when you would want to use this module:
- You want to place a top branding bar on your site that you can drop blocks into
- You create a feature that has context positioned blocks that should ALWAYS function a certain way
- You want an area that's theme independent so you don't need to worry about different devs ignoring theme region naming conventions
By using a simple function call, additional regions can be added to the system. This module does nothing on its own but you can find an implementation of it here, here, and here. ELMS Alpha 5+ ships with these 3 regions (top, left and right) so look to them for their method of creation. The Right region is just a module and could be the cleanest example while Top and Left provides blocks and Feature integration for automatic install and setup of the regions. Much of the code in these three regions should work in other Drupal systems though it is not directly supported.
This module seeks to replace all the insane replication currently out there in projects like appbar and others that provide far more then just scaffolding, while still replicating much of the same architecture.
Basic usage from regions.api.php:
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_block_callback', //optional
),
'myregion2' => array(
'title' => 'My region 2',
),
);
}See the API for a list of other useful hooks or see the ELMS Navigation Left, Right or Top regions for example usage.
Created Regions can then be bundled with Features much more cleanly to do anything from provide a chat window to standardize the placement of admin like functionality without giving access to admin bar type of modules.
Project initially created as part of the Penn State University ELMS Initiative.
Downloads
Recommended releases
Development releases
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Content Display, Developer, Theme Enhancements
- Reported installs: 35 sites currently report using this module. View usage statistics.
- Last modified: December 27, 2011