Skip to content
Snippets Groups Projects
Commit 7a774745 authored by Jeffrey Fortune's avatar Jeffrey Fortune
Browse files

add in the help hook for the drupal help page.

parent 3b43dd4d
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,34 @@
* Provides a way to add background images dynamically.
*/
use Drupal\Core\Url;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
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;
}
}
/**
* Implements hook_form_alter().
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment