function hook_blocks

4.x blocks.module hook_blocks()
5.x blocks.module hook_blocks()

Example of hook_blocks.

Modules wishing to provide blocks should implement this function. The purpose is to describe which blocks you can render, by returning an array as shown. The index of the array is the "delta" which hook_render_block($delta) will use when deciding how to render the block on the screen.

See also

hook_render_block

6 functions implement hook_blocks()

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

announcements_blocks in modules/announcements/announcements.module
hook_blocks. Returns an array of available blocks offered by this module in this format: array( delta => "This is the title of the block.", ), );
blocks_blocks in modules/blocks/blocks.module
Implementation of hook_blocks
blocks_get_available_blocks in modules/blocks/blocks.module
Return an array of blocks which we can assign and display, as defined by other modules' hook_blocks function.
blocks_render_blocks in modules/blocks/blocks.module
This function will actually render the HTML for the blocks requested for a particular section and region.
content_blocks in modules/content/content.module
hook_blocks. Returns an array of available blocks offered by this module in this format: array( delta => "This is the title of the block.", ), );

... See full list

File

modules/blocks/blocks.module, line 305

Code

function hook_blocks() {
  return array(
    "b1" => t("Tools menu"),
    "admin_tools" => t("Admin Tools menu"),
    "login_form" => t("Login form"),
  );
}