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
Commits
0f61ec8b
Commit
0f61ec8b
authored
3 months ago
by
Kamlesh Kishor Jha
Committed by
Ruben Marques
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3339168
by Kamlesh Kishor Jha: Implement hook_help()
parent
262c5fb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Issue #3339168: Implement hook_help()
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
menu_link_sync.module
+32
-0
32 additions, 0 deletions
menu_link_sync.module
with
32 additions
and
0 deletions
menu_link_sync.module
+
32
−
0
View file @
0f61ec8b
...
...
@@ -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'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment