Skip to content
Snippets Groups Projects

Issue #3339168: Implement hook_help()

Merged Kamlesh Kishor Jha requested to merge issue/menu_link_sync-3339168:8.x-1.x into 8.x-1.x
1 file
+ 32
0
Compare changes
  • Side-by-side
  • Inline
+ 32
0
@@ -8,7 +8,39 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Menu\MenuTreeParameters;
use Drupal\node\Entity\Node;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function menu_link_sync_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the menu_link_sync module.
case 'help.page.menu_link_sync':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Menu Link Sync module helps synchronize the
position of menu items within Drupal installs with separate menus for
every language, for instance when we have different "Main Menu -
French", "Main Menu - English" and "Main Menu - Spanish" menus.') . '</p>';
$output .= '<p>' . t('This synchronization may be useful when the
structure of the menus is too different for i18n_menu or Entity
Translation to be adequate solutions, but when the trees for
different languages are still similar enough for some sort of
synchronization of menu structures to be desirable.') . '</p>';
$output .= '<p>' . t('This module provides a "Synchronize" button
to the "Menu link settings" on the node forms for translated nodes.
By pressing the "Synchronize" button, the parent and the relative
tree position of the menu link for this translated node are
automatically calculated to be as close as possible to the
parent and relative position of the menu link for the "source"
node. The form will then be updated through an AJAX call and the
new parent and weight will be automatically selected.') . '</p>';
return $output;
default:
}
}
// Integration with menu_link_weight module.
require_once DRUPAL_ROOT . '/' . \Drupal::service('extension.path.resolver')->getPath('module', 'menu_link_sync') . '/menu_link_sync.menu_link_weight.inc';
Loading