Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    217
    Thanks
    1
    Thanked 0 Times in 0 Posts

    building dynamic menu problem ??

    Hello forums!!
    I am getting bit problem in displaying dynamic css menus which uses <li><ul> tags.
    I had the table with structure as:
    tbl_cat
    |id|title|parent_id|
    |1|Item 1| 0 |
    |2|Item 2| 0 |
    |3|Item 3| 0 |
    |4|Item 4| 0 |
    |5|Item Item 2.1| 2 |
    |6|Item Item 2.2| 2 |
    |7|Item Item 3.1| 3 |
    |8|Item Item 3.2| 3 |
    |9|Item Item 3.3| 3 |
    I have to show these values as following in order to display the proper multilevel menu.
    <li><a href="#">Item 1</a></li>
    <li><a href="#">Item 2</a>
    <ul>
    <li><a href="#">Item 2.1</a></li>
    <li><a href="#">Item 2.2</a></li>
    </ul>
    </li>
    <li><a href="#">Item 3</a>
    <ul>
    <li><a href="#">Item 3.1</a></li>
    <li><a href="#">Item 3.2</a>
    <ul>
    <li><a href="#">Item 3.2.1</a></li>
    <li><a href="#">Item 3.2.2</a></li>
    <li><a href="#">Item 3.2.3</a></li>
    </ul>
    </li>
    </ul>
    </li>
    <li><a href="#">Item 4</a></li>
    Has anybody some idea in generating proper <li><ul> tags for the fields so that it becomes as above ..
    Note it can be n level deep.
    Thanks in advance for any tips and suggestions.
    Last edited by PHPycho; 11-29-2007 at 05:31 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •