0

I have a special menu that is part of the page. I include it in the template like

$block = module_invoke('menu_block', 'block_view', DEF_BOOKLETS_MBID);
print render($block['content']);

Menu's are part of the interface, not of the content. If I use i18n, the translated menu will appear fine if the interface language switches.

However, the client does not want that. The interface is supposed to be one language, but the content can switch languages. That works too - apart from the menu block inside the content.

Is there a way to render a menu_block inside a template in the current content language ?

2
  • {{crickets!!}} the reason why this is important, is because, if I switch the interface language, some of the interface of the site (like 'log out') gets translated automatically, while most of the interface (like 'click here dude') does not. breaks the site.
    – commonpike
    Aug 11, 2015 at 19:03
  • {{crickets}} moreover, the whole admin menu gets translated, which makes the client get totally lost.
    – commonpike
    Aug 11, 2015 at 19:04

1 Answer 1

0

ok - this is extremely ugly, but seems to work

global $language,$language_content;
$org_language = $language;
$language = $language_content;
$block = module_invoke('menu_block', 'block_view', IAF_BOOKLETS_MBID);
$language = $org_language;

print render($block['content']);

Feel free to boo me on this one :-D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.