function hook_page_build

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 system.api.php hook_page_build(&$page)
cle7 system.api.php hook_page_build(&$page)
elmsmedia7 system.api.php hook_page_build(&$page)
icor7 system.api.php hook_page_build(&$page)
meedjum_blog7 system.api.php hook_page_build(&$page)
mooc7 system.api.php hook_page_build(&$page)

Add elements to a page before it is rendered.

Use this hook when you want to add elements at the page level. For your additions to be printed, they have to be placed below a top level array key of the $page array that has the name of a region of the active theme.

By default, valid region keys are 'page_top', 'header', 'sidebar_first', 'content', 'sidebar_second' and 'page_bottom'. To get a list of all regions of the active theme, use system_region_list($theme). Note that $theme is a global variable.

If you want to alter the elements added by other modules or if your module depends on the elements of other modules, use hook_page_alter() instead which runs after this hook.

Parameters

$page: Nested array of renderable elements that make up the page.

See also

hook_page_alter()

drupal_render_page()

Related topics

20 functions implement hook_page_build()

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

accessibility_theming_page_build in sites/all/modules/ulmus/accessibility/modules/accessibility_theming/accessibility_theming.module
Implements hook_init().
admin_menu_page_build in sites/all/modules/ulmus/admin_menu/admin_menu.module
Implements hook_page_build().
admin_menu_toolbar_page_build in sites/all/modules/ulmus/admin_menu/admin_menu_toolbar/admin_menu_toolbar.module
Implementation of hook_page_build().
block_page_build in modules/block/block.module
Implements hook_page_build().
cis_helper_page_build in profiles/cis/modules/custom/cis_helper/cis_helper.module
Implements hook_page_build().

... See full list

1 invocation of hook_page_build()
drupal_render_page in includes/common.inc
Renders the page, including all theming.

File

modules/system/system.api.php, line 905
Hooks provided by Drupal core and the System module.

Code

function hook_page_build(&$page) {
  if (menu_get_object('node', 1)) {
    // We are on a node detail page. Append a standard disclaimer to the
    // content region.
    $page['content']['disclaimer'] = array(
      '#markup' => t('Acme, Inc. is not responsible for the contents of this sample code.'),
      '#weight' => 25,
    );
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.