Search the Community
Showing results for tags 'mega dropdown menu'.
-
Hi all. I need some assistance with dynamically populating a mega drop-down menu across 6 columns (Bootstrap 4) with the languages retrieved from a database query (Forum project - Chapter 17). I have searched the internet without any success. Any help will be much appreciated. My code is included below. Regards // Select a language: echo '<li class="nav-item nav-item-icon hidden-md-down dropdown megamenu"> <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' . $words['lang'] . ' <span><i class="fa fa-globe"></i></span></a> <div class="dropdown-menu"> <div class="mega-dropdown-menu row row-no-padding"> <div class="col-md-4 col-lg-2 ml-lg-auto"> <ul class="megadropdown-links"> <li>'; // RetrRetrieve all the languages and add to the pull-down menu: $q = "SELECT id, lang FROM languages WHERE status='Active' ORDER BY lang ASC"; $r = mysqli_query($dbc, $q); if (mysqli_num_rows($r) > 0) { while ($menu_row = mysqli_fetch_array($r, MYSQLI_NUM)) { echo '<a class="dropdown-item" href="?lid=' . $menu_row[0] . '">' . $menu_row[1] . '</a>'; } } mysqli_free_result($r); echo '</li> </ul> </div> </div> </div> </li>';
- 12 replies