Reply To: Number of level

Home Forums Older releases 1.0.x Number of level Reply To: Number of level

#3407
oitsuki
Participant

Ok I am looking, but it’s an error of me sorry.

I let you my code php (it can help some people), you will see inside the code a class nav-item, this element can allow to work with boostrap4. (It can help yu for next release).

In this code , I put in comment the where the problem start, maybe I forget something !!!

Thanks


       <ul id="main-menu" class="sm sm-mint">
<?php
  // level 1
  foreach($menu_parent as $key => $menus) {
    if (is_file(OSCOM::getConfig('dir_root') . 'images/menu/' . $menus['image'])) {
      $image = HTML::image($OSCOM_Template->getImageDirectory() . '/menu/' . $menus['image'], null, null, 15);
    } else {
      $image = '';
    }

    if ($menus['link'] != '') {
      echo '<li><a href="link($menus['link']) . '">' . $menus['label'] . '</a></li>';
    } else {
      echo '<li><a>' . $image . ' ' . $menus['label'] . '</a>';
    }

// level 2
    if (!is_null($menus['sub_menu'])) {
      echo '<ul>';
      foreach($menus['sub_menu'] as $second_level) {

        if (is_file(OSCOM::getConfig('dir_root') . 'images/menu/' . $menu_sub[$second_level]['image'])) {
          $image = HTML::image($OSCOM_Template->getImageDirectory() . '/menu/' . $menu_sub[$second_level]['image'], null, null, 15);
        } else {
          $image = '';
        }

        if ($menu_sub[$second_level]['link'] != '') {
          echo '<li><a href="link($menu_sub[$second_level]['link']) . '">' . $image . ' ' . $menu_sub[$second_level]['label'] . '</a></li>';
        } else {
          echo '<li class="sub_menu_1st_level"><a>' . $image . ' '  . $menu_sub[$second_level]['label'] . '</a>';
        }

// level 3
        if ($menu_sub[$second_level]['sub_menu'] != '')  {
          echo '<ul>';

          foreach($menu_sub[$second_level]['sub_menu'] as $third_level) {

            if (is_file(OSCOM::getConfig('dir_root') . 'images/menu/' . $menu_sub[$third_level]['image'])) {
              $image = HTML::image($OSCOM_Template->getImageDirectory() . '/menu/' . $menu_sub[$third_level]['image'], null, null, 15);
            }

            if (!is_null($menu_sub[$third_level]['link'])) {
              echo '<li><a href="link($menu_sub[$third_level]['link']) . '">' . $image . ' ' . $menu_sub[$third_level]['label'] . '</a></span></li>';
            } else {
              echo '<li><a>' . $image . ' ' . $menu_sub[$third_level]['label'] . '</a>';
            }





/*
* pb start here

            if ($menu_sub[ $third_level]['sub_menu'] != '')  {
              echo '<ul>';

              foreach($menu_sub[ $third_level ]['sub_menu'] as $fourth_level) {

                if (is_file(OSCOM::getConfig('dir_root') . 'images/menu/' . $menu_sub[$fourth_level]['image'])) {
                  $image = HTML::image($OSCOM_Template->getImageDirectory() . '/menu/' . $menu_sub[$fourth_level]['image'], null, null, 15 );
                }

                if (!is_null($menu_sub[$fourth_level]['link'])) {
                  echo '<li><a href="link($menu_sub[$fourth_level]['link']) . '">' . $image . ' ' . $menu_sub[$fourth_level]['label'] . '</a></li>';
                } else {
                  echo '<li><a>' . $image . ' ' . $menu_sub[$fourth_level]['label'] . '</a>';
                }


                echo '</li>';
              }
              echo '</ul>';
            }
*/
            echo '</li>';
          }
          echo '</ul>';
        }
        echo '</li>';
      }
      echo '</ul>';
    }
    echo '</li>';
  }
?>
  </ul>

</nav>

Register

You will be emailed a link to set your password.

Login

Lost password?