943,719 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2494
  • PHP RSS
Feb 27th, 2009
0

creating a multi-level category search/navigation system

Expand Post »
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?
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
cali_dotcom is offline Offline
51 posts
since Apr 2008
Feb 28th, 2009
0

Re: creating a multi-level category search/navigation system

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 ?
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 728
Bite my shiny metal ass!
pritaeas is offline Offline
4,166 posts
since Jul 2006
Mar 1st, 2009
0

Re: creating a multi-level category search/navigation system

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
Reputation Points: 10
Solved Threads: 5
Junior Poster
jakx12 is offline Offline
123 posts
since Jan 2009
Mar 1st, 2009
0

Re: creating a multi-level category search/navigation system

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.
Reputation Points: 128
Solved Threads: 43
Posting Whiz
death_oclock is offline Offline
389 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Please help to find the whois of .in, .co.in etc.
Next Thread in PHP Forum Timeline: basic > php mail() - configuration





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC