8.3.x help.api.php hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
8.0.x help.api.php hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
8.1.x help.api.php hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
8.2.x help.api.php hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
8.4.x help.api.php hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
4.6.x core.php hook_help($section)
4.7.x core.php hook_help($section)
5.x core.php hook_help($section)
6.x core.php hook_help($path, $arg)
7.x system.api.php hook_help($path, $arg)

Provide online user help.

By implementing hook_help(), a module can make documentation available to the engine or to other modules. All user help should be returned using this hook; developer help should be provided with Doxygen/api.module comments.


$section: Drupal URL path (or: menu item) the help is being requested for, e.g. admin/node or user/edit. Recognizes special descriptors after a "#" sign. Some examples:

  • admin/modules#name The name of a module (unused, but there)
  • admin/help#modulename The module's help text, displayed on the admin/help page and through the module's individual help link.
  • user/help#modulename The help for a distributed authorization module (if applicable).
  • node/add#nodetype The description of a node type (if applicable).

Return value

A localized string containing the help text. Every web link, l(), or url() must be replaced with %something and put into the final t() call: $output .= 'A role defines a group of users that have certain privileges as defined in !permission.'; $output = t($output, array('!permission' => l(t('user permissions'), 'admin/user/permission')));

For a detailed usage example, see page_example.module.

Related topics

38 functions implement hook_help()

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

aggregator_help in modules/aggregator/aggregator.module
Implementation of hook_help().
block_help in modules/block/block.module
Implementation of hook_help().
blogapi_help in modules/blogapi/blogapi.module
Implementation of hook_help().
blog_help in modules/blog/blog.module
Implementation of hook_help().
book_help in modules/book/book.module
Implementation of hook_help().

... See full list

6 invocations of hook_help()
help_links_as_list in modules/help/help.module
help_menu in modules/help/help.module
Implementation of hook_menu().
help_page in modules/help/help.module
Menu callback; prints a page listing general help for all modules.
menu_get_active_help in includes/menu.inc
Returns the help associated with the active menu item.
system_admin_by_module in modules/system/system.module
Menu callback; prints a listing of admin tasks for each installed module.

... See full list


developer/hooks/core.php, line 509
These are the hooks that are invoked by the Drupal core.


function hook_help($section) {
  switch ($section) {
    case 'admin/help#block':
      return '<p>' . t('Blocks are boxes of content that may be rendered into certain regions of your web pages, for example, into sidebars. Blocks are usually generated automatically by modules (e.g., Recent Forum Topics), but administrators can also define custom blocks.') . '</p>';

    case 'admin/build/block':
      return t('<p>Blocks are boxes of content that may be rendered into certain regions of your web pages, for example, into sidebars. They are usually generated automatically by modules, but administrators can create blocks manually.</p>
<p>If you want certain blocks to disable themselves temporarily during high server loads, check the "Throttle" box. You can configure the auto-throttle on the <a href="@throttle">throttle configuration page</a> after having enabled the throttle module.</p>
<p>You can configure the behaviour of each block (for example, specifying on which pages and for what users it will appear) by clicking the "configure" link for each block.</p>', array('@throttle' => url('admin/settings/throttle')));