Вот пример кода своего рендера меню 'main-menu'
function custom_main_menu() {
global $language;
$item = menu_get_item();
$bp = base_path();
$menu_data = menu_tree_all_data('main-menu');
$menu_data = i18n_menu_localize_tree($menu_data,$language->language);
$menu_data = menu_tree_output($menu_data);
$menu_data = array_intersect_key($menu_data, array_flip(array_filter(array_keys($menu_data), 'is_numeric')));
$menu = '<ul class="navbar-nav">';
foreach ($menu_data as $menu_link) {
$link = $menu_link['#original_link'];
$submenu = $menu_link['#below'];
if($submenu) {
$class = ' ts-has-child';
$submenu = array_intersect_key($submenu, array_flip(array_filter(array_keys($submenu), 'is_numeric')));
} else $class = '' ;
$link['link_path'] == $item['path'] ? $active = ' active' : $active = '' ;
$link['external'] ? $url = $link['link_path'] : $url = $bp.$link['link_path'];
$menu .= '<li class="nav-item'.$class.'">';
$menu .= '<a class="nav-link'.$active.'" href="'.$url.'">'.$menu_link['#title'];
$active ? $menu .= '<span class="sr-only">(current)</span>' : NULL ;
$menu .= '</a>';
if($submenu) {
$menu .= '<span class="d-block d-sm-none carret"></span><ul class="ts-child">';
foreach ($submenu as $submenu_link) {
$link = $submenu_link['#original_link'];
$submenu2 = $submenu_link['#below']; $submenu = array_intersect_key($submenu, array_flip(array_filter(array_keys($submenu), 'is_numeric')));
$submenu2 ? $class = ' ts-has-child' : $class = '' ;
if($submenu2) {
$class = ' ts-has-child';
$submenu2 = array_intersect_key($submenu2, array_flip(array_filter(array_keys($submenu2), 'is_numeric')));
} else $class = '' ;
$link['link_path'] == $item['path'] ? $active = ' active' : $active = '' ;
$link['external'] ? $url = $link['link_path'] : $url = $bp.$link['link_path'];
$menu .= '<li class="nav-item'.$class.'">';
$menu .= '<a class="nav-link'.$active.'" href="'.$url.'">'.$submenu_link['#title'];
$active ? $menu .= '<span class="sr-only">(current)</span>' : NULL ;
$menu .= '</a>';
if($submenu2) {
$menu .= '<ul class="ts-child">';
foreach ($submenu2 as $submenu2_link) {
$link = $submenu2_link['#original_link'];
$link['link_path'] == $item['path'] ? $active = ' active' : $active = '' ;
$menu .= '<li class="nav-item">';
$menu .= '<a class="nav-link'.$active.'" href="'.$bp.$link['link_path'].'">'.$submenu2_link['#title'];
$active ? $menu .= '<span class="sr-only">(current)</span>' : NULL ;
$menu .= '</a></li>';
}
$menu .= '</ul>';
}
$menu .= '</li>';
}
$menu .= '</ul>';
}
$menu .= '</li>';
}
$menu .= '</ul>';
return $menu;
}