Jump to content

UL LI, tags under parent menu


Recommended Posts


I created the menu using Codeigniter Framework, it works great at websol.biz, unfortunately it returns <UL><LI> in each parent menu, how do I restrict Home and other buttons in a loop OR how to I program accordingly that it should not loop UL LI, tags under parent menu


you can see the code samples of my practice.

webpage - > websol.biz (live)

<!-- Top Bar-->
<div class="top">
<div class="row">
<div class="col-sm-3">
<div class="logo">
<a href="index.html"><img src="<?php echo base_url(); ?>public/images/logo.png" alt="" />
<div class="col-sm-9">
<nav id="desktop-menu">
<ul class="sf-menu" id="navigation">
<?php foreach($content as $row) {
$title = $row->menu_name;
$id = $row->id;
$link = $row->link_id;
$id_a = $row->id_c;
$method_name = $this->router->fetch_method();
if ($method_name==strtolower($title)) { echo "class=current"; } ?> ><a href="<?php echo base_url(); ?><?php echo $link; ?>"><?php echo $title; ?></a>
echo "<ul>";
for($i=0;$i<count($sub_menu); $i++) {
$row2 = $sub_menu[$i];
$id_c = $row2->id_c;
$title_c = $row2->menu_name2;
$parent_num = $row2->parent_id;
$anchor = $row2->link_id;
//echo "<br>".$title."--id_c = ".$id_c = $row2->id_c;
if(strtolower($title)==strtolower($id_c)) { ?>
<li><a href="<?php echo $anchor; ?>"><?php echo $title_c; ?></a></li>
<?php } else echo ""; ?>
<?php } ?>
<?php echo "</ul>"; ?>
<?php } ?>
<!-- End of Top Bar-->

Database - > http://prntscr.com/7yd6xh

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.