Same name and namespace in other branches
  1. 7.x-1.4 fitvids.module \fitvids_help() 1 comment
  2. 7.x-1.x fitvids.module \fitvids_help() 1 comment
  3. 8.x-1.x fitvids.module \fitvids_help() 1 comment

Implements hook_help().

Through hook_help(), a module can make documentation available to the user for the module as a whole or for specific routes. Where the help appears depends on the $route_name specified.

Help text will be displayed in the region designated for help text. Typically this is the 'Help' region which can be found at admin/structure/block.

The help text in the first example below, will appear on the simple page at examples/page_example/simple.

The second example text will be available on the admin help page (admin/help) in the list of help topics using the name of the module. To specify help in the admin section combine the special route name of 'help.page' with the module's machine name, as in 'help.page.page_example' below.

See also

hook_help()

File

./fitvids.module, line 35

Code

function fitvids_help($route_name, RouteMatchInterface $route_match) {
    switch ($route_name) {
        case 'help.page.fitvids':
            $output = '';
            $output .= '<h3>' . t('About') . '</h3>';
            $output .= '<p>' . t("The Fitvids module uses <a href=\"@github\" rel=\"external\">the FitVids.js jQuery plugin</a> to achieve fluid/responsive video embeds. You don't need it for pure HTML5 videos.", [
                '@github' => FITVIDS_GITHUB_URL,
            ]) . '</p>';
            $output .= '<h3>' . t('Uses') . '</h3>';
            $output .= '<p>' . t("Use this module if you are using a responsive theme (such as Bootstrap), and want the videos to scale to fit the available space. By default it supports YouTube, Vimeo and Kickstarter.") . '</p>';
            return $output;
            break;
    }
}