hi, i'm creating the admin section for a multi-level category search/navigation system. i mean like, when a visitor comes to the site and they are looking for data, first a list of categories appears. for example ..... states....departments......etc. so when a user clicks on states, he gets another list of subcategories, and it can go on till he reaches the file/info he's looking for. i also wanted to make it multi dimensional so that a particular piece of information could be reached by different paths.

on the admin side, i dont want to put a limit on the number of categories/levels an administrator can put in.

Now my problem is figuring out the logic necessary to sort and store the data when the administrator uploads them so that in the front end, it would be easy for visitors to find them.

does anyone have any ideas how i can go about this?

7 Years
Discussion Span
Last Post by death_oclock

Sounds like you should be able to add several categories to a piece of data (say a record), allowing it to be reached by different paths. Next to that you would need to have your categories setup in a table (or multiple), ordering them the way you need them (parent, child) in your search system. Much like a menu system. You define a category, and what other category is it's parent. Can you give an example of how one piece of data would be reached by different paths ?


i suggest: setting up a table that has fields determine what the sub catagories parent is. That is is the easiest way. When displaying the links, you will need to select all from the database were the parent category is equal to the previous link clicked. I suggest you do this with ajax and use php and a mysql database with the fields like so:
Parent | Link


A good way to implement this is giving each subcategory a reference (field) to the parent category's unique ID. You can do this with an auto-incrementing int field. A root category can just have the parent -1 (for example) to specify that it is at the top level.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.