Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search Results: Keyword(s)

Quote Reply
Search Results: Keyword(s)
Is there a tag that is used to display the keyword(s) that are searched for? I've been noticing people mispelling words and coming up with No Search Results....but I think if they see on the results page "Your Search For shoppign produced no results" they would realize that they typed shopping wrong. Anyway, I saw this on Eliot's site, so I know it has been done......if any knows off hand, what I need to add to the search.html template that would be great!

Thank You
Quote Reply
Re: Search Results: Keyword(s) In reply to
You have to edit the search.cgi file and use $query where the error code lines appear.

You should have the following codes in your search_error.html template file:

Code:
<%error%>

That tag is defined in the search.cgi file.

Good luck.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Search Results: Keyword(s) In reply to
Hey Elliot,

That makes sense, but the only problem is that I can't find the error code info in the search.cgi so that I made add the $query. This is the closest I found:

# Return unless we have results.
((keys %link_results > 0) or ($#category_results >= 0)) or
&site_html_search_failure ("no matching records") and return;

I would also like to add the keyword(s) that are searched to be added to the search results page (exp: your search for 'keyword(s)' returned XX results)....however I'm sure I wouldn't use the <%error%> tag in the search results, so what would I add to the searchresults.html template?? Any suggestions? Thanks for your time!
Quote Reply
Re: Search Results: Keyword(s) In reply to
You add HTML codes between the double quotes where it states no matching records, like the following:

Code:
&site_html_search_failure ("No matching records for <b>$in{'query'}</b>.
Please try your search again.") and return;

To put keywords searched for in your search results, all you have to do is add the following tag to your search_results.html template file:

Code:
<%query%>

I REALLY hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Search Results: Keyword(s) In reply to
Thank you Elliot, that was very helpful! :-)
Quote Reply
Re: Search Results: Keyword(s) In reply to
You're welcome.

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------