Community Documentation

hook_help

5 core.php hook_help($section)
6 core.php hook_help($path, $arg)
7 help.api.php hook_help($path, $arg)
8 help.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.

Parameters

$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/modules#description The description found on the admin/system/modules page.
  • 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

▾ 44 functions implement hook_help()

aggregator_help in modules/aggregator.module
Implementation of hook_help().
archive_help in modules/archive.module
Implementation of hook_help().
block_example_help in developer/examples/block_example.module
Implementation of hook_help().
block_help in modules/block.module
Implementation of hook_help().
blogapi_help in modules/blogapi.module
Implementation of hook_help().
blog_help in modules/blog.module
Implementation of hook_help().
book_help in modules/book.module
Implementation of hook_help().
chameleon_help in themes/chameleon/chameleon.theme
comment_help in modules/comment.module
Implementation of hook_help().
contact_help in modules/contact.module
Implementation of hook_help().
drupal_help in modules/drupal.module
Implementation of hook_help().
drupal_page_help in modules/drupal.module
Menu callback; print Drupal-authentication-specific information from user/help.
fileupload_help in developer/examples/fileupload.module
Implementation of hook_help.
filter_example_help in developer/examples/filter_example.module
Implementation of hook_help().
filter_help in modules/filter.module
Implementation of hook_help().
forum_help in modules/forum.module
Implementation of hook_help().
help_help in modules/help.module
Implementation of hook_help().
legacy_help in modules/legacy.module
Implementation of hook_help().
locale_help in modules/locale.module
Implementation of hook_help().
menu_get_active_help in includes/menu.inc
Returns the help associated with the active menu item.
menu_help in modules/menu.module
Implementation of hook_help().
multipage_form_example_help in developer/examples/multipage_form_example.module
Implementation of hook_help().
nodeapi_example_help in developer/examples/nodeapi_example.module
Implementation of hook_help().
node_access_example_help in developer/examples/node_access_example.module
Implementation of hook_help().
node_example_help in developer/examples/node_example.module
Implementation of hook_help().
node_help in modules/node.module
Implementation of hook_help().
page_example_help in developer/examples/page_example.module
Implementation of hook_help().
page_help in modules/page.module
Implementation of hook_help().
path_help in modules/path.module
Implementation of hook_help().
ping_help in modules/ping.module
Implementation of hook_help().
poll_help in modules/poll.module
Implementation of hook_help().
profile_help in modules/profile.module
Implementation of hook_help().
search_help in modules/search.module
Implementation of hook_help().
statistics_help in modules/statistics.module
Implementation of hook_help().
story_help in modules/story.module
Implementation of hook_help().
system_help in modules/system.module
Implementation of hook_help().
taxonomy_help in modules/taxonomy.module
Implementation of hook_help().
theme_help in includes/theme.inc
Return a themed help message.
throttle_help in modules/throttle.module
Implementation of hook_help().
tracker_help in modules/tracker.module
Implementation of hook_help().
upload_help in modules/upload.module
Implementation of hook_help().
user_help in modules/user.module
Implementation of hook_help().
watchdog_help in modules/watchdog.module
Implementation of hook_help().
xmlrpc_server_method_help in includes/xmlrpcs.inc
XML-RPC method system.methodHelp maps to this function.

File

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

Code

<?php
function hook_help($section) {
  switch ($section) {
    case 'admin/help#block':
      return t('<p>Blocks are the boxes visible in the sidebar(s)
        of your web site. These are usually generated automatically by
        modules (e.g. recent forum topics), but you can also create your
        own blocks using either static HTML or dynamic PHP content.</p>');
      break;
    case 'admin/modules#description':
      return t('Controls the boxes that are displayed around the main content.');
      break;
  }
}
?>
Login or register to post comments