Drupal 7 Custom Grouped menu list with image, Two level Sub Menu

Hi,

Want to have sub menu group with image and render your way, check the below code.

Modules Used : Menu Icons this module provide a UI for, associate a image/icon with a menu item.
Drupal : 7
Theme : Batrick

Place the below code on page.tpl, themes template.

<?php
/**
* Install menu_icons module for image embeding with menu.
*/
print '

    ';
    $menucustom =menu_tree_all_data('main-menu');
    foreach($menucustom as $key=>$menuparent){
    print '
  • ';
    print l($menuparent['link']['link_title'],$menuparent['link']['link_path'],array('attributes'=>array('style'=>'background-color:white')));
    if(is_array($menuparent['below'])){
    print '
      ';
      foreach($menuparent['below'] as $key1=>$menuchild1){
      $icon = 'Only local images are allowed.';
      print '
    • ';
      print ''.$icon.'';
      print '
      '.l($menuchild1['link']['link_title'],$menuchild1['link']['link_path'],array('attributes'=>array('style'=>'background-color:white'))).'

      ';
      if(is_array($menuchild1['below'])){
      print'

        ';
        foreach($menuchild1['below'] as $key1=>$menuchild2){
        print '
      • ';

TB Mega Menu

Drupal module-TB Mega Menu

TB Mega Menu allows you to create a mega menu with an innovative back-end user interface and the created mega menus are synchronized with Drupal core menu.

Subscribe with RSS Subscribe to RSS - drop down menu