Hi,

I'm in the process of changing theme (to Typebased) and my multilingual primary links menu went out of the window.

My set up of menu items in two languages with language selection on each menu item, became doubled with the code:

if (!empty($navigation)):

endif;

I tried a couple of different approaches before finding this module, including exchanging the code above for that in the previous theme. All the nodes that the menus point to have been translated using i18n.

After installing and enabling i18nmenu_node I disabled the secondary language menu items, and checked that the first and second language where linked together. The result is now that my second language don't have a menu at all, but that the doubling of the menu have disappeared (naturally since I disabled the other language menu items).

I was under the impression that this module would make the second language menu automatically out of the first langauge menu items if they were correctly linked?

Where am I going wrong?

/ Annika

Comments

Annika’s picture

That code example didn't turn out well, a new try with " instead of < >.


"?php if (!empty($navigation)): ?"
"div id="navigation" class="clear-block" "
"?php print $navigation; ?"
"/div"
"?php endif; ?"

plach’s picture

Status: Active » Postponed (maintainer needs more info)

I was under the impression that this module would make the second language menu automatically out of the first langauge menu items if they were correctly linked?

Yes, that's right. Probably you're experiencing a language selection issue.

Are you using a menu block or outputting the menu links directly into your page template? In the first case are you using the [i18n] version of the menu block?

Try to temporarily set language selection to "All content. No language conditions apply" and see if you still have troubles.

plach’s picture

Status: Postponed (maintainer needs more info) » Fixed

Closing the issue. Feel free to reopen it if you need.

Status: Fixed » Closed (fixed)

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

pluess’s picture

Status: Closed (fixed) » Active

For me setting the language selection to "All content. No language conditions apply" solved problem. Is this considered to be the right setting to work with this module?

plach’s picture

Status: Active » Postponed (maintainer needs more info)

Are you using a menu block or outputting the menu links directly into your page template? In the first case are you using the [i18n] version of the menu block?

pluess’s picture

We are using the [i18n] version of the menu block.

tragic.rich’s picture

Version: 6.x-1.0-alpha3 » 6.x-1.0-beta2

I am experiencing this issue with my primary and secondary links. Everything is working fine with the menu blocks, I replaced my footer_links block with the [i19n]footer_links block and everything works great!

However with my primary/secondary links the menu items for the nodes that have been translated disappear when viewing the site in a language other than the default (e.g. Spanish). The primary/secondary menus are enabled in my theme and printed out in page.tpl as follows:
print theme('grid_block', $primary_links_tree_2, 'secondary-menu');

How can I get this working properly with the menu translation (node) module? I even tried to enable the [i18n] primary menu block but the menu items still disappear when viewing the secondary language.

The weird thing is that all menu items are showing up properly when viewing the homepage in spanish, but once I go to any other page the menu items disappear.

Any help/insight is greatly appreciated!

plach’s picture

The first move to troubleshoot this is disabling language selection (see the project description for details) and see if menus start behaving properly.

tragic.rich’s picture

Thanks plach!
I found out my problem. /admin/settings/language -> multilingual system I had to set the content selection mode to "All content. No language conditions apply."
I assume this is because this module handles taking you to the correct content.
Then I merely filtered my views by current language and everything is working great!! Thanks for the quick response.

plach’s picture

Well, MTN should work with any language selection mode, so there is something wrong with your configuration (or with MTN :)). Probably the theme variables used to output the menu tree are not properly prepared or there is some piece of code that is building the menu tree cache before MTN can prepare it (see lines 153-170 of i18nmenu_node.module).

gease’s picture

Hello, plach and everybody,
I'm also experiencing the same problem. I'm trying to make menutrails module work with i18nmenu_node, and the only way I succeed is using "all languages" content negotiation mode. Seems that the culprit is call to menu_tree_page_data() in menutrails module (line 119 of menutrails.module in the body of menutrails_get_breadcrumbs function, which is being called upon hook_nodeapi execution for 'view' operation), for when i change it to menu_tree_all_data() (as suggested here(http://drupal.org/node/314238#comment-3798092) menu displays correctly (but menutrails provides no breadcrumbs). So it seems that menutrails builds the menu cache, not the i18nmenu_node. My knowledge about execution order of different hooks fails here, so I appreciate any advice.

plach’s picture

@gease:

My knowledge about execution order of different hooks fails here, so I appreciate any advice.

Edit: try to install a custom module, with a lighter weight than Menu Trails, implementing hook_nodeapi('view') and calling i18nmenu_node_navigation_links_prepare().

gease’s picture

That's what I actually did (http://drupal.org/node/314238#comment-3894136), but it seems to me that calling i18nmenu_node_navigation_links_prepare() at the right moment should be the responsibility of i18nmenu_node, at least when it doesn't concern modules order (Menu Trails sets itself a weight of 1, so its hooks are executed after those of i18nmenu_node). That's just a suggestion. Thank you for this module that makes multilingual Drupal more natural.

plach’s picture

@gease:

Well, the "right moment" is not a universal concept :)

Calling i18nmenu_node_navigation_links_prepare() on node view does not always work as we need to prepare menu link variables on any page. That said calling it twice should not be harmful, but we must ensure that i18nmenu_node acts before menutrails.

Do you mind to create a patch and test it?

plach’s picture

Status: Postponed (maintainer needs more info) » Fixed

I suppose this is fixed, reopen if needed.

Status: Fixed » Closed (fixed)

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