Skip to content
Snippets Groups Projects
Commit 0f61ec8b authored by Kamlesh Kishor Jha's avatar Kamlesh Kishor Jha Committed by Ruben Marques
Browse files

Issue #3339168 by Kamlesh Kishor Jha: Implement hook_help()

parent 262c5fb0
No related branches found
No related tags found
1 merge request!2Issue #3339168: Implement hook_help()
......@@ -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';
......
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