function hook_page_top
Same name in other branches
- 9 core/lib/Drupal/Core/Render/theme.api.php \hook_page_top()
- 8.9.x core/lib/Drupal/Core/Render/theme.api.php \hook_page_top()
- 10 core/lib/Drupal/Core/Render/theme.api.php \hook_page_top()
Add a renderable array to the top of the page.
Parameters
array $page_top: A renderable array representing the top of the page.
Related topics
2 functions implement hook_page_top()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- big_pipe_test_page_top in core/
modules/ big_pipe/ tests/ modules/ big_pipe_test/ big_pipe_test.module - Implements hook_page_top().
- session_exists_cache_context_test_page_top in core/
modules/ system/ tests/ modules/ session_exists_cache_context_test/ session_exists_cache_context_test.module - Implements hook_page_top().
File
-
core/
lib/ Drupal/ Core/ Render/ theme.api.php, line 1142
Code
function hook_page_top(array &$page_top) : void {
$page_top['my_module'] = [
'#markup' => 'This is the top.',
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.