Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kidd1126 on
I create two menu in each language use the i18n module.
But this two menu always display at the same time no matter which language is the current language.
These menu doesn't related to node.
Can any body help?
Comments
It's happend in theme
It's happend in theme bluemaster I noticed it's display correct in garland
I found the solution change
I found the solution change all the menu_tree functions into i18n_menu_translated_tree
Wrap it inside "if (module_exists('i18n_menu)) {..} else {..}"
Thanks. Very useful.
To avoid that the i18n_menu_translated_tree() function gets called while the i18n_menu module isn't active, wrap it inside if (module_exists('i18n_menu)) {..} else {..}. The original menu_tree() function goes in the else {..} section.
An example:
if (module_exists('i18n_menu')) {
$tree = i18n_menu_translated_tree($pid);
}
else {
$tree = menu_tree($pid);
}
https://www.martin.postma.website/