Last active
November 13, 2017 08:54
-
-
Save ipwa/61112c6cc272915fa71bb44aa4009e66 to your computer and use it in GitHub Desktop.
Use different menus for different languages in Drupal 7 template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $language; | |
$main_menu = menu_tree_output(menu_tree_all_data('main-menu', NULL, 2)); | |
$menu_principal = menu_tree_output(menu_tree_all_data('menu-menu-principal-espanol', NULL, 2)); | |
?> | |
<?php if ($language->language == 'en'): ?> | |
<?php print drupal_render($main_menu); ?> | |
<?php elseif ($language->language == 'es'): ?> | |
<?php print drupal_render($menu_principal); ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment