I'm using the internationalization module, which allows me to translate the menu to multiple languages by assigning each item to a specific language. The dynamic persistent menu shows all items, regardless of the language. If I have two languages, then I have two menu items for every page. I really like the layout of your menu, but it's not useable as it is for my site.

CommentFileSizeAuthor
#9 dynamic_persistent_menu.module.txt14.4 KBSinan Erdem

Comments

yrocq’s picture

Version: 6.x-1.2 » 6.x-2.x-dev
Assigned: Unassigned » yrocq
Status: Active » Postponed (maintainer needs more info)

Will be implemented in version 2.

alex72rm’s picture

Component: User interface » Code
Category: feature » bug
Status: Postponed (maintainer needs more info) » Active

We are waiting for version 2 for many months. Any news?

Sinan Erdem’s picture

subscribe

yrocq’s picture

For now, I haven't much time to work on this module. I just changed the "Maintenance status" of the project page to reflect that. This module isn't abandoned but I can't tell when the version 2 will be finished. If someone submit a patch to fix this issue, I will integrate it. I am really sorry for the inconvenience.

yrocq’s picture

Status: Active » Fixed

Fixed in branch 6.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Sinan Erdem’s picture

Status: Closed (fixed) » Active

I can confirm that primary level menu items are working ok under different language conditions: if a menu item is on a certain language only, it doesn't show on the other languages.

But if the menu item is secondary level, it is always displayed on every language, even if I choose a specific language for this item..

Sinan Erdem’s picture

I just solved this issue by adding these lines to corresponding places in dynamic_persistent_menu.module:

Changed this line:
if ($submenu_item['link']['hidden'] == 0) {
to this:
if ($submenu_item['link']['hidden'] == 0 && (empty($submenu_item['link']['options']['langcode']) || $submenu_item['link']['options']['langcode'] == $language->language)) {

Added this line:
if ($link2['hidden'] == 0 && (empty($link2['options']['langcode']) || $link2['options']['langcode'] == $language->language)) {
just before this line:
$submenu_items .= theme('dynamic_persistent_menu_menu_item', $link2, 'dynamic-persistent-menu-sub-menu-item ' . $extra_class, 'dynamic-persistent-menu-sub-menu-item'.$link2['mlid']);

And added a } to close this "if" just after $i++;

Sinan Erdem’s picture

StatusFileSize
new14.4 KB

Attaching the final file...