I have installed Menutrail on a multilingual site running on three domains, one for each language. Each language has another primary links menu. The settings are saved separately using this in my settings.php: (after this tip here http://drupal.org/node/165527#comment-870834).
$conf['i18n_variables'] = array(
'menutrails_menu',
'menutrails_node_types',
'menutrails_terms',
);
Now everything works great, it even works for the Biblio node-type (from Biblio module. BUT, for some reason it only works on one of the menus, the English one. On the other two domains, using different primary menus, only for the Biblio type the correct parent menu will not be set. I've spent hours reading about and trying all kinds of tricks, no luck. But since it works for one language/menu with Menutrails, any suggestions to make it work?
Comment | File | Size | Author |
---|---|---|---|
#23 | menutrails.module.patch | 624 bytes | dmotilla |
#15 | menutrails.patch | 1.39 KB | rj |
#12 | menutrails-314238-12.patch | 1.33 KB | James Andres |
#10 | menutrails-20100503.patch | 1.87 KB | paoloteo |
Comments
Comment #1
joshk CreditAttribution: joshk commentedI'm willing to bet there is additional code needed to support internationalization. This will need some further research to figure out. Thanks for bringing this to my attention!
Comment #2
ar-jan CreditAttribution: ar-jan commentedCool, I'll be available for testing when there are new developments.
Comment #3
joshk CreditAttribution: joshk commentedExcellent. I saw all the code in the other thread here:
http://drupal.org/node/165527
It'll probably be some days before I really have time to dig into it, but i18n is an important feature (esp for Drupal 6) and I want to support it.
Comment #4
sharlak CreditAttribution: sharlak commentedI added 'menutrails_menu', 'menutrails_node_types' and 'menutrails_terms' to 'i18n_variables' in my settings.php as it has been said here and tested it. For the moment everything seems to work fine. I have created a menu for my Spanish content (called Test-es) and another one for its translation to Basque (called Test-eu). After configuring menu trails module in both languages I got the active-trail class in the defined parent items as I expected (using both nodetypes and taxonomy configuration), so I think that this solves the issue.
I'm using Internationalization 6.x-1.0 and Menu Trails 6.x-1.0. Can anyone give more feedback?
Comment #5
tibbsa CreditAttribution: tibbsa commentedI have tried, unsuccessfully, to use Menu Trails on a new bilingual (French/English) D6 site. I added the menutrails_* variables to the i18n_variables list in settings.php (as I have done for numerous other modules, so I know this 'works'), and this did indeed allow me to configure separate English & French assignments in the UI.
On this site, two site-specific menus are used (i.e. not Primary or Secondary links) - one for English and one for French.
Associating by node type or taxonomy works great for the primary language (English), and results in appropriate breadcrumbs and "active" item indication.
It does not appear to be doing anything at all when operating in French, however.
Is there anywhere or anything else I could check?
Comment #6
domidc CreditAttribution: domidc commentedSet the multilingual variables. If you have urls going to the same path in both languages like a view that has a language filter for example, you need to hack the module a little.
To the owner of this module: proper i18n support would be nicer, but for now this fix works fine for me.
Change this function :
Into:
Comment #7
marcushenningsen CreditAttribution: marcushenningsen commentedI can confirm that entering the above mentioned lines of code into settings.php works perfectly. This, however, seems like a workaround. Should this somehow be entered into the module itself?
Comment #8
DomoSapiens CreditAttribution: DomoSapiens commentedI have the same problem, but adding the 'i18n_variables' did the trick for me.
It works great! Thanks
Comment #9
loominade CreditAttribution: loominade commentedsubscribe
Comment #10
paoloteo CreditAttribution: paoloteo commentedConfirming that this at the end of the settings.php
$conf['i18n_variables'] = array(
'menutrails_menu',
'menutrails_node_types',
'menutrails_terms',
);
and applying the patch I attached with the above code from #6 works great.
Comment #11
loominade CreditAttribution: loominade commentedmaybe you should use http://drupal.org/project/node_breadcrumb instead
Comment #12
James Andres CreditAttribution: James Andres commentedThis patch is a simpler approach IMO, it uses the
i18nmenu_localize_tree()
function to transparently switch to a localized menu tree which allows the rest of menutrails to keep on running without knowing the difference.Comment #13
iamjon CreditAttribution: iamjon commentedSubscribing
Comment #14
geasePatch #12 worked perfectly - for a single multi-lingual menu. Many thanks, James.
Comment #15
rj CreditAttribution: rj commentedThe attached patch is the same as #12 except that it allows menutrails to play nice with the i18nmenu_node module by calling menu_tree_all_data instead of menu_tree_page_data.
Comment #16
geaseNeither #12 nor #15 "plays nicely" with i18nmenu_node. #12 doesn't show breadcrumbs. #15 doesn't show links in the menu.
Comment #17
rj CreditAttribution: rj commentedRegarding #16, breadcrumbs and menu links display properly for me. You may want to check your config settings, and possibly check for conflict with another module. Also, if you're using DHTML menu, you'll need to set all parent links to be expanded, see http://drupal.org/node/299783#comment-3781566.
Comment #18
gease@rj,
I wonder how you manage to get breadcrumbs displayed, given menu_tree_all_data has even different signature from menu_tree_page_data and requires second parameter to set 'in_active_trail' property. AFAICS, there is no way to get breadcrumbs with menu_tree_all_data(). Instead, using patch from #12 and setting content negotiation to "all languages" solves the problem, but that's not the perfect way.
To display everything correctly, I did the following:
1. Added
before the call to menu_tree_page_data in menutrails_get_breadcrumbs() to get menu cache set up correctly. But this broke theme settings cache, so
2. I changed
theme_get_setting('zen_breadcrumb');
totheme_get_setting('zen_breadcrumb', TRUE);
in zen_breadcrumb (in fact, I overrode zen_breadcrumb in my sub-theme).This seems like an ugly solution to me, but the only one that works. Hopefully someone can come up with something better.
Comment #19
rj CreditAttribution: rj commentedDoh, I'm using the custom_breadcrumb module for breadcrumbs, not menutrail, which is probably why breadcrumbs are working. Have you tried calling i18nmenu_node_navigation_links_prepare() from hook_nodeapi('view')? Maybe that would do the trick?
Comment #20
einpol CreditAttribution: einpol commentedany news on this topic?? -.-
Comment #21
MXTSubscribing
Comment #22
gkom CreditAttribution: gkom commentedSubscribing
Comment #23
dmotilla CreditAttribution: dmotilla commentedI have added in menutrails_get_breadcrumbs function, after $tree = menu_tree_page_data($menu); the following code:
I think this function is that translates the tree as the language of each item. What do you think is the best solution?
Comment #24
marco.giaco CreditAttribution: marco.giaco commentedWhat about this? It is the only working in my case
@@ -104,9 +103,9 @@ function _menutrails_recurse_crumbs($tree, $item, &$crumbs, $above = array()) {
}
if ($menu_item['link']['link_path'] == $item['href']) {
foreach ($above as $trail_item) {
- $crumbs[] = l($trail_item['link']['link_title'], $trail_item['link']['link_path']);
+ $crumbs[] = l(t($trail_item['link']['link_title']), $trail_item['link']['link_path']);
}
- $crumbs[] = l($menu_item['link']['link_title'], $menu_item['link']['link_path']);
+ $crumbs[] = l(t($menu_item['link']['link_title']), $menu_item['link']['link_path']);
break;
}
Comment #25
-otto- CreditAttribution: -otto- commentedSubscribing
Comment #26
Einkahumor CreditAttribution: Einkahumor commentedI could not get this working properly with any of the methods in this issue so I gave up in the end. I tried out Node Breadcrumb but eventually gave up on that one too because of a totally unrelated but equally show-stopping (for my current project) issue. I ended up using Menu Position and that one worked quite nicely (6.x needed to be patched for multilingual support but it actually worked). It even seems to have an excellent 7.x version.
Just thought I'd post this info so it might be of help to some.