On this page
API
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:
- 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.
- If Advanced help is enabled, it will generate a link to whatever help it makes available.
- 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
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion