Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How can I set up a link that will only search one category?

Quote Reply
How can I set up a link that will only search one category?
The default is search all categories in include_search_bar.html. Is it possible for me to set up another page so that users can search only one category by default? For instance, I will have a page with all my categories. Then if they click on a category, they will go to another page to search only that category. Now they have to choose between seach all categories and search only this category?
Quote Reply
Re: [banana] How can I set up a link that will only search one category? In reply to
I don't think you could do this with LSQL itself, but you should be able to write some HTML pages that include an adjusted search form, where you manually 'force' searching of only that category.

Your best bet would probably be to copy and paste the search form at the category you want people to search on, and then adjust the HTML of the form to remove the option for search all/search cat and put in a hidden form field to set the option for 'search only this category'.

Hope this helps

All the best
Shaun
Quote Reply
Re: [banana] How can I set up a link that will only search one category? In reply to
I don't see why it wouldn't be possible. Try the following;

1) Add a new page in your templates folder, something like new_search.html. In it, have a drop down list of the categories (if required I will provide a global that does this in real time)...make sure it is called 'catid'.

2) Then call page.cgi?t=new_search&d=1. That should bring up your new search page, with the drop down list. Then just select the category you want, and it will search only that category Smile

I have done this on another site...and it all works ok. So it shouldn't be too hard ;)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How can I set up a link that will only search one category? In reply to
Thank you for your help. I will try to do it based on what you two have suggested and see what happens next. Thanks a million.
Quote Reply
Re: [Andy] How can I set up a link that will only search one category? In reply to
Andy,

Good suggestion - sorry banana, I tend to think in static mode since that's how I operate Qango Smile

All the best
Shaun