You are here

function bg_img_field_help in Background Image Field 8

Implements hook_help().

File

./bg_img_field.module, line 15
Provides a way to add background images dynamically.

Code

function bg_img_field_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.bg_img_field':
      $links = [
        ':field' => Url::fromRoute('help.page', [
          'name' => 'field',
        ])
          ->toString(),
        ':field_ui' => \Drupal::moduleHandler()
          ->moduleExists('field_ui') ? Url::fromRoute('help.page', [
          'name' => 'field_ui',
        ])
          ->toString() : '#',
      ];
      $output = '<h3>' . t('About') . '</h3>';
      $output .= '<p>';
      $output .= t('Background Image Field module allows you to create a field on an entity type. It requires responsive images mapping in order to offer the best image quality for the device it is rendering on. The field will define the CSS selector to attach the background image too and then allow you basic CSS options repeat, size, and position so you can define a  style per image in your content.');
      $output .= '</p>';
      $output .= '<p>';
      $output .= t('Administrators can add background image field on the <a href=":field_ui">Field UI</a> if module is enabled. For more information on fields see the <a href=":field">Field module help page</a>.', $links);
      $output .= '</p>';
      $output .= '<p>';
      $output .= t("Project documentation can be found on the project page, <a href='https://www.drupal.org/project/bg_img_field' target='_blank'>Background Image Field</a>.");
      $output .= '</p>';
      return $output;
  }
}