Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
menu_link_sync
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
menu_link_sync
Merge requests
!2
Issue
#3339168
: Implement hook_help()
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3339168
: Implement hook_help()
issue/menu_link_sync-3339168:8.x-1.x
into
8.x-1.x
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Kamlesh Kishor Jha
requested to merge
issue/menu_link_sync-3339168:8.x-1.x
into
8.x-1.x
2 years ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
8.x-1.x
version 1
471fd65a
2 years ago
8.x-1.x (base)
and
latest version
latest version
9b7643a4
1 commit,
7 months ago
version 1
471fd65a
1 commit,
2 years ago
1 file
+
32
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
menu_link_sync.module
+
32
−
0
Options
@@ -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