From e3d1d01dde45a3fcbf8eecd6b85afcc9e7e20f13 Mon Sep 17 00:00:00 2001 From: Sonal Gyanani <61830-Sonalmg@users.noreply.drupalcode.org> Date: Mon, 23 Jan 2023 18:16:38 +0530 Subject: [PATCH] Issue #3335796: Add hook help --- entity_reference_display.module | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/entity_reference_display.module b/entity_reference_display.module index ea1b943..8d4e407 100644 --- a/entity_reference_display.module +++ b/entity_reference_display.module @@ -8,6 +8,32 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Form\FormStateInterface; use Drupal\entity_reference_display\Plugin\Field\FieldFormatter\EntityReferenceRevisionsDisplayFormatter; +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function entity_reference_display_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the entity_reference_display module. + case 'help.page.entity_reference_display': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('This module defines a simple field type for display mode selection for entity + reference fields. This allows an editor to select how they would like the + references displayed. </p> <p> <strong> + "Display mode" field type: </strong> This field allows you to specify a display mode + for the rendering of entity reference fields. You can configure available + options to show only certain display modes. The user then selects one from these + and affects the way your entity reference field renders items.</p> <p> + <strong>"Selected display mode" field formatter:</strong> This formatter allows you to render + referenced entities with a selected display mode. The formatter is available + only for entity reference fields where the base entity contains at least one + display mode field. When there are more display fields available, you can choose + one.') . '</p>'; + return $output; + } +} /** * Implements hook_form_alter(). -- GitLab