Tree navigation ... need some help - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Tree navigation ... need some help (/showthread.php?tid=33202) |
Tree navigation ... need some help - El Forum - 08-18-2010 [eluser]Warz[/eluser] Hi, I'm making a tree navigation. Like this: Code: - Home Code: id |parent_id|lft|rgt|order_id| name| link When the menu is generated it will be with the following links: Quote:id: 1 - no link As you can see it adds up each link from all parents.... Now the problem, I want to use class="selected" to mark what page we are currently on. The problem is I do have links not stored in the tree structure meaning that I cannot simply compare the URL string with link because then, if the link is not saved in database I will end up not having anything selected. Imagine this: http://domain.com/forum/topic/edit It's a link not stored in the tree structure, and in this case I want "Forum" to be the one with the class="selected". Basically, I'm wondering does anyone know of a good solution to making a navigation system? I tried for many days thinking out the best way to do this, but I end up not happy with it. |