Welcome Guest, Not a member yet? Register   Sign In
Menu Help.
#1

[eluser]Popcorn[/eluser]
How would I go about creating a navigation table in my database that includes categories? So far the table is called "navigation" and has an id,name and url field. I would prefer to add a category and have this reflected as shown in the right hand side of my website situated here : http://www.leveldesign.info/index.php Thanks for any help.

Code:
<div class="box">
<H4>LEVELDESIGN</H4>
<UL>
    {navigation}
    <LI><a href="{url}">{name}</a></LI>
    {/navigation}
</UL>
</div>

That's how it works at the moment, it doesn't included categories and just echos out links for the "leveldesign" category.

Any help for adding categories to this is appreciated.
#2

[eluser]esra[/eluser]
Do a search on the forums for 'nested sets' and 'adjacency list'. These are two models for handling hierarchial data (e.g., categories) in relational databases. There is a wiki article and sample code from Thunder UK on the wiki called nested sets. The categories demo included with the code could be converted to a tree-like menu system based on nested unordered lists. Refer to the additional reading in the documentation to learn how nested sets work.




Theme © iAndrew 2016 - Forum software by © MyBB