Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to search in just one category

Quote Reply
How to search in just one category
hi everyone

Yes I have searched the archives and the best explanation I found - I have posted below but it just didn't work for me.

Can anyone help me please - I used the code below and found it hasn't worked. I must have done something wrong. You can see this code at work here
http://204.73.203.120/pages/3G_Publications/Magazines/more1.html
The problem is the search cannot be restricted to THAT category but instead searches ALL even when this option is not selected?! How do I fix this ?- thanks for your help
Steve

------------

Apparently the answer ?
but....its me :-(

Posted by
Subject Re: Search in this category?
Posted by AnthroRules (Veteran)
Posted on 28-Sep-00 02:34 PM

I believe that you need to add the following codes in the category.html file:
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<input type="radio" name="category" value="<%category_id%>"> Search this Category
<input type="radio" name="category" value="All"> Whole Site
<input type="text" name="query" size="40">
<input type="submit" value="Search">
</form>

Quote Reply
Re: How to search in just one category In reply to
This has been built into Links since 2.0 ... maybe earlier? Here is the code from the search_bar.html file:

Code:
<table bgcolor="#ffffcc" border="0" width="100%" cellspacing="0" cellpadding="0">
<form action="<%db_cgi_url%>/search.cgi" method="GET">

<tr><td>
<table cellpadding=6 cellspacing=0 border=0 width="100%">
<tr><td><%body_font%>Looking for something in particular?</font>
<input type="text" size=12 name="query">
<input type=submit value="Search!">
<%if category_id%>
<%body_font%><small>
<input type="radio" name="catid" value="" checked> the entire directory
<input type="radio" name="catid" value="<%category_id%>"> only this category</small></font>
<%endif%>
</td><td align=right>
<%body_font%><small><a href="<%db_cgi_url%>/search.cgi">More search options</a></small></font></td></tr>
</table></td></tr>
</form>
<tr><td bgcolor="#ffcc00" height=3 width="100%">
<img src="<%url_images%>ClearShim.gif" width=<%body_width%> height=1 border=0></td></tr>
</table>

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: How to search in just one category In reply to
Thanks pugdog - that was the answer and it now works!

Cheers
Steve