PDA

View Full Version : How to limit search to one of my categories?



The Old Man
10-15-2007, 02:08 PM
Hi,
I have the Zoom Search working great on my site and the search page uses several categories. I have a search box on my front page that works great.

What I would like to do, it add another search box to my news archive page which will limit its search key words to one of my categories (in this case news). Is it possible to limit a search box to just one category?

Thanks!

Ray
10-16-2007, 12:20 AM
Yep. Take a look at this FAQ:
Q. How do I put search forms on pages besides the search page? (Or define my own search form?) (http://www.wrensoft.com/zoom/support/faq_howto.html#searchform)

Refer to the section under the heading 'Defining a search form for a categories enabled website' in particular. As you will see, you can specify a hidden input tag for a category which the user won't see or be able to change, thereby allowing you to limit the search to a particular category. Say the category number for your "News" category is 0, then you will just need a tag like so within your custom search form:


<input type="hidden" name="zoom_cat[]" value="0">

Hope that helps.

The Old Man
10-16-2007, 06:00 AM
Excellent, thanks for that!

LOL! Actually, my news category is selected by category 0 as in your example!