Hi
I am trying to make my site multilingual but the "MD Boom One-Page Menu block" seems to cause a conflict with i18n menu internationalization submodule (When I activate the i18n menu translation submodule I have this error: Notice: Undefined index: link ini18n_menu_localize_tree()(line377ofC:\xampp\htdocs\Sanblasveleros\sites\all\modules\contrib\i18n\i18n_menu\i18n_menu.module))
The only way I found to work around this problem is to create one menu for each language and show each block only to the selected language using i18n functionality.
The problem is: I am trying to build a secondOne-PageMain Menu but can't replicate this menu using the Drupal interface.I have an idea it should be something around md_boom_ module.module but not sure how to work with it.
Please, would you be so kind to give a solution? Either replicate the menu or fix the problem with i18n menu submodule.
Thank you very much.
I think I achieved the duplication...at least it's working.
Is it the right approach?
What I did is to add this to the md_boom_module.module:
$blocks['menu2'] = array(
'info' => t('Md Boom One-page Main Menu2'), //The name that will appear in the block list.
'cache' => DRUPAL_CACHE_PER_ROLE, //Default
);
and this:
case 'menu2' :
$block['subject'] = t('<none>');
if (user_access('access content')) {
$main_menu = menu_navigation_links('menu-menu-principal-esp');
if (function_exists('i18n_menu_localize_tree')) {
$main_menu = i18n_menu_localize_tree($main_menu);
}
if(theme_get_setting('logo_retina_path','md_boom')) {
$logo_path = md_boom_module_setting_check_path(theme_get_setting('logo_retina_path','md_boom'));
} elseif(theme_get_setting('logo_normal_path','md_boom')) {
$logo_path = md_boom_module_setting_check_path(theme_get_setting('logo_normal_path','md_boom'));
} else {
$logo_path = $base_url.'/'.drupal_get_path('theme','md_boom').'/logo.png';
}
$content = '<nav> <div class="wrapper clearfix">';
if(drupal_is_front_page() == TRUE) {
$content .= '<a class="logo" href="#top"><img src="'.$logo_path.'"/></a>';
} else {
$content .= '<a class="logo" href="'.$base_url.'"><img src="'.$logo_path.'"/></a>';
}
$content .= '<ul class="clearfix">';
foreach($main_menu as $key => $values){
$menu_title = $values['title'];
$menu_icon = '';
if(isset($values['icon']['icon'])) {
$menu_icon = $values['icon']['icon'];
}
$enable_menu_scroll = variable_get('enable-scroll-'.$key.'');
if($enable_menu_scroll == 1) {
$menu_scrollto_path = variable_get(''.$key.'-scrollto-path');
if(drupal_is_front_page() == true) {
if($menu_scrollto_path == '#index'){
$content .= '<li class="current"><a href="'.$menu_scrollto_path.'" class="'.$menu_icon.'"></i>'.t($menu_title).'</a></li>';
}
else{
$content .= '<li><a href="'.$menu_scrollto_path.'" class="'.$menu_icon.'"></i>'.t($menu_title).'</a></li>';
}
} else {
$content .= '<li><a href="'.$base_url.'/'.$menu_scrollto_path.'" class="'.$menu_icon.'"></i>'.t($menu_title).'</a></li>';
}
} else {
if($values['href'] == '<front>') {
$content .= '<li><a href="'.$base_url.'"><i class="'.$menu_icon.'"></i>'.t($menu_title).'</a></li>';
} elseif(url_is_external($values['href']) == false) {
$content .= '<li><a href="'.$base_url.'/'.$values['href'].'"><i class="'.$menu_icon.'"></i>'.t($menu_title).'</a></li>';
} else {
$content .= '<li><a href="'.url($values['href']).'"><i class="'.$menu_icon.'"></i>'.t($menu_title).'</a></li>';
}
}
}
$content .= '</ul>';
$content .= '<div class="wrapper-dropdown-3" tabindex="1">
<span>Home</span>
<ul class="dropdown">';
foreach($main_menu as $key_dd => $value_dd) {
$menu_title_dd = $value_dd['title'];
$menu_icon_dd = '';
if(isset($value_dd['icon']['icon'])) {
$menu_icon_dd = $value_dd['icon']['icon'];
}
$enable_menu_scroll = variable_get('enable-scroll-'.$key_dd.'');
if($enable_menu_scroll == 1) {
$menu_scrollto_path_dd = variable_get(''.$key_dd.'-scrollto-path');
if(drupal_is_front_page() == true) {
if($menu_scrollto_path_dd == '#index'){
$content .= '<li class="current"><a href="'.$menu_scrollto_path_dd.'" class="'.$menu_icon_dd.'"></i>'.t($menu_title_dd).'</a></li>';
}
else{
$content .= '<li><a href="'.$menu_scrollto_path_dd.'" class="'.$menu_icon_dd.'"></i>'.t($menu_title_dd).'</a></li>';
}
} else {
$content .= '<li><a href="'.$base_url.'/'.$menu_scrollto_path_dd.'" class="'.$menu_icon_dd.'"></i>'.t($menu_title_dd).'</a></li>';
}
} else {
if($value_dd['href'] == '<front>') {
$content .= '<li><a href="'.$base_url.'"><i class="'.$menu_icon_dd.'"></i>'.t($menu_title_dd).'</a></li>';
} elseif(url_is_external($value_dd['href']) == false) {
$content .= '<li><a href="'.$base_url.'/'.$value_dd['href'].'"><i class="'.$menu_icon_dd.'"></i>'.t($menu_title_dd).'</a></li>';
} else {
$content .= '<li><a href="'.url($value_dd['href']).'"><i class="'.$menu_icon_dd.'"></i>'.t($menu_title_dd).'</a></li>';
}
}
}
$content .= '</ul>
</div>
</div>
</nav>';
$block['content'] = $content;
}
break;
Hi,
Please take a look at below tutorial for creating multi-language menu:
https://www.youtube.com/watch?v=Sx9lJ_hOrCw.
Also, we highly recommend you use module Entity Translation instead of module i18n.