Advertising sustains the DA. Ads are hidden for members. Join today

On this page

API

Last updated on
19 March 2018

This is documentation for Drupal 7, which is no longer supported. Learn more and find resources for Drupal 7 sites

If you want to make use of this module, first make it a dependency in your module's .info-file. You do that with the following line:

dependencies[] = advanced_help_hint

The module provides this API function:

advanced_help_hint_docs($project, $doclink = NULL, $repo = FALSE)

The major features of this function are:

  1. If Advanced help is not enabled, and you've indicated that there are helps file in your repo, it will suggest that it is enabled.
  2. If Advanced help is enabled, it will generate a link to whatever help it makes available.
  3. If you tell it that online documentation for your module exists, it will generate a link to that as well.

The hint generated is suitable for use in the project's hook_help.

Parameters:

$project: String. The short name of your module or theme.

$doclink: String. An URL to online documentation, for example community documentation about your project on Drupal.org.

$repo: Boolean. Set this TRUE if your project makes use of the Advanced help framework to have have online help, or includes a README.md or README.txt help file.

Return value:

A string with the generated hint text.

Example

Provided your module is named “mymodule”, assuming that online documentation exists on the following URL “https://www.drupal.org/node/2461745”, and that in a file named “README.md”, “README.txt” or a subdirectory “help” included in the repo, here are an example of how to make a rather minimal hook_help by making use of advanced_help_hint_docs:

function mymodule_help($path, $arg) {
  if ($path == 'admin/help#mymodule') {
    return '<p>' . t('Some short description the module.') .
      '</p>' . '<p>' .
      advanced_help_hint_docs('mymodule',
        'https://www.drupal.org/node/2954222', TRUE) .
      '</p>';
  }
}

Help improve this page

Page status: No known problems

You can: