May 21, 2014

hook_help() is the same as in D7

hook_help() in Drupal 8 has not changed and can be implemented in the .module file exactly as in D7.

The  .module  file is placed at the top-level directory of the module. In our case the location is


Very abbreviated outline of D7 version, which I copied verbatim to D8:
function optimizely_help($path, $arg) {
  switch ($path) {

    case 'admin/help#optimizely':
      return t('...<a href="@settings">Optimizely...',
        array('@settings' => url('admin/config/system/optimizely/settings')));

    case 'admin/config/system/optimizely':
      return t('... A listing of the Optimizely ...');
    // Other cases ...

Update for Drupal 8, alpha 13: hook_help() has a different signature and is no longer unchanged from Drupal 7. See




  1. I look forward to a review of the hook_help content. I always find that someone new to a project is the best person to review help/docs as they make no assumptions.

    1. I much agree that people who are new to a piece of software can provide fresh input as to the UX. So let's do this review sometime soon.