| 7 block.api.php | hook_block_configure($delta = '') |
| 8 block.api.php | hook_block_configure($delta = '') |
Define a configuration form for a block.
Parameters
$delta: Which block is being configured. This is a unique identifier for the block within the module, defined in hook_block_info().
Return value
A configuration form, if one is needed for your block beyond the standard elements that the block module provides (block title, visibility, etc.).
For a detailed usage example, see block_example.module.
See also
Related topics
10 functions implement hook_block_configure()
1 invocation of hook_block_configure()
File
- modules/
block/ block.api.php, line 156 - Hooks provided by the Block module.
Code
function hook_block_configure($delta = '') {
// This example comes from node.module.
$form = array();
if ($delta == 'recent') {
$form['node_recent_block_count'] = array(
'#type' => 'select',
'#title' => t('Number of recent content items to display'),
'#default_value' => variable_get('node_recent_block_count', 10),
'#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)),
);
}
return $form;
}
Login or register to post comments
Comments
the important information is
the important information is missing - you can use this hook only within the module, that defines the created block.
Why not to use
Why not to use like:
<?phpvariable_get('node_recent_block_count');
?>
--
Regards,
Alexander Matveev
If you're referring to the
If you're referring to the '10' used as a second argument, that is the default value if the 'node_recent_block_count' variable isn't set to anything.