Category Parameter

Post Reply
mmcfadden
Posts: 158
Joined: Tue May 20, 2003 2:17 pm

Category Parameter

Post by mmcfadden »

I would like to remove the Category drop down list from the Search script and I would like to still pass the selected category to the results page. I have found that when I do a search on my web site home page and select a category drop down the search results page has this category automatically selected. However with the drop down removed if I just hit submit again I am now searching everything.

Our problem originates from the fact that when we add additional categories and we now have 15. We don't want users to be confused by having all of those options on the results page. We would like to display only the selected option or remove the drop down all together. Is there a way to do this?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Category Parameter

Post by mark »

You've already removed the drop down. Now you need to replace it with a hidden input by the same name with the desired value filled in.
<input type=hidden name=cq value="$cq">
mmcfadden
Posts: 158
Joined: Tue May 20, 2003 2:17 pm

Category Parameter

Post by mmcfadden »

Our site is a directory or Portal in which every page has different drop down options. So potentially every page going to the same script needs to have a different hidden variable(category) selected each time they go to the search script. Is what you suggested going to work in my case? I am guessing that setting that hidden variable would be done on my html pages and then passed to the script right?
mmcfadden
Posts: 158
Joined: Tue May 20, 2003 2:17 pm

Category Parameter

Post by mmcfadden »

That works great thank you!
mmcfadden
Posts: 158
Joined: Tue May 20, 2003 2:17 pm

Category Parameter

Post by mmcfadden »

I am wanting to display something different than the Drop down box but with the selected category displayed in text. For example on the Search results page I would like to display this in text
You are now searching in "category here" Is there a way to use the hidden input to dynamically display the category?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Category Parameter

Post by mark »

Use <if> or <switch> to decide what to show the used based on the variable's value. Or use <sql> to lookup the category name in the categories table based on the category number variable.
Post Reply