PDA

View Full Version : Creating Links out of Categories in Search


tim.nealon288075
04-28-2009, 06:57 PM
I have a question that I am sure will get laughed at for its easiness...well, here it goes.

I generate all my pages for dataassist and so on. The search option is a drop down menu with categories in it. They select a category and get whisked away to the results page with the items that match that category. In my case, we'll use Children's Books and Infant Books, along with others.

What I would like to do is make those category choices, links that go down the side of the page, instead of options in the drop down. This way, someone could just click on a link that says 'Children's Books' and it would take them to the results page with all the children's books on them and so on.

Can someone help me figure out how to do this. I tried Googling it, but coulnd't find anything relevant enough.

Thank You

Ray Borduin
04-29-2009, 07:20 AM
What part are you having difficulty with:

Creating the list of links that looks correct, or making the links work correctly?

tim.nealon288075
04-29-2009, 07:52 AM
I have no problem making the links looks correct. They would just be list items going down the left hand side. The problem I am having is making the links work with the generated pages and display the search results that correspond with that link.
So, whenever someone would click on 'Children's Books', it would take them to the results page and displayed would be all the results in the database that have the category of 'children's books'.
I know that each link would have to be linked to the results page, however I don't know how write out, okay, if this link is clicked go to the results page and display only this category and so on.
I hope I am explaining that well enough.

Thank You

Ray Borduin
04-29-2009, 08:06 AM
Sure you are explaining it well enough. What is the trigger you are using for the database search filter on the results page?

You would want to make the links mimic the trigger and form values used. Most likely the resulting link will look something like: pagename.php?button_x=1&catfield=Childrens Books

that is assuming your search button was originally named "button" and was an image button and that your trigger refers to $_GET['button_x'] and that your original form element was named catfield and was in a form method="get" form.

tim.nealon288075
04-29-2009, 12:39 PM
Okay, I thought I had this figured out. Ray, I followed your advice, and it does go to the Results page when I click on a link. However, it displays ALL the results in all the categories, not just the category that the link is specific to. So when I click on the children's book link, it displays all the results in the database, regardless of what category they belong to.
I googled that one and once again, cannot find anything specific enough to tell me what I am doing wrong.
Is there anything else I can do?

Ray Borduin
04-29-2009, 01:07 PM
Check your trigger and the value. One must be wrong. I couldn't tell without looking at the search code and looking at the link.

tim.nealon288075
04-29-2009, 04:21 PM
Ray, I did have one of them wrong. I think I have everything working flawlessly....(we'll see, haha)

Thank You very much for all of your help.