Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search Results

(Page 1 of 2)
> >
Quote Reply
Search Results
I want to customize my search function more.

How do I make it so that when someone types in "automoblie" then the results page is one I created for anything relevant to cars.

I want to create templates to match the keyword entered by the surfer.

thanks in advance for any help

Last edited by:

PelsLvr: Nov 30, 2001, 2:14 PM
Quote Reply
Re: [PelsLvr] Search Results In reply to
Hi,

You could do this in your search_results template:

Code:
<%if query like 'automobiles'%>
<%include search_auto.html%>
<%elsif query like 'computers'%>
<%include search_computers.html%>
..
<%else%>
<%include search_default.html%>
<%endif%>

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Results In reply to
Great Function !!!!!!
but if I want to associate more keywords on searches how I can make????
Example:

<%if query like 'automobiles''motors'%>
<%include search_auto.html%>
<%elsif query like 'computers''floppy'%>
<%include search_computers.html%>
..<%else%>
<%include search_default.html%>
<%endif%>

What's the right code???



Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Search Results In reply to
Alex Can U help me????



Thanks in Advance
Bye From Italy
Quote Reply
Re: [fabio] Search Results In reply to
If you open GT/Template.pm in a text editor there is lots of great info about possible options for use in the templates. From about line 640 onwards.

You'd want something like....

<%if query like 'foo' or query like 'bar'%>

I _think_


Quote Reply
Re: [PaulW] Search Results In reply to
ok Thanks again!!!!


Thanks in Advance
Bye From Italy
Quote Reply
Re: [PaulW] Search Results In reply to
Don't need to do that, you can go to:

http://gossamer-threads.com/...help_guide_libs.html (username admin pass admin).

All the pod is already in your admin panel.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Results In reply to
OMG I've never even seen that.

Edit:

It goes into frames with the url above but not by default is that right?

Last edited by:

PaulW: Dec 2, 2001, 2:50 PM
Quote Reply
Re: [PaulW] Search Results In reply to
It should go into the frames page from the admin help by default.

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Search Results In reply to
Hmm it doesn't do that for me.
Quote Reply
Re: [Alex] Search Results In reply to
Alex does doing this make my template I created the one to be used when it lists search results?

I thought it was going to be fairly easy to do until I read all of the posts after yours.

I was looking for something simple that when I type in "boxes" in my search function the boxes.html template is used to create the page just like for the category templates.

please help

Quote Reply
Re: [PelsLvr] Search Results In reply to
Alex's suggestion will work for what you want:

<%if query like 'automobiles'%>
<%include search_auto.html%>
<%elsif query like 'computers'%>
<%include search_computers.html%>
..
<%else%>
<%include search_default.html%>
<%endif%>

You just need to tweak the templates so that they display how you want them to.

I did have a related question though. I would like to not only have the search results for "automobiles" display using the automobile.html template, but also be listed without grouping by categories.

Right now, I can turn category display on or off for the entire site, but is it possible to control the grouping by categories for just a single search term?


Quote Reply
Re: [BryanL] Search Results In reply to
I tried to put
<%if query like 'automobiles'%>
<%include search_auto.html%>
<%elsif query like 'computers'%>
<%include search_computers.html%>
..
<%else%>
<%include search_default.html%>
<%endif%>

into the search_results.html like alex said, all I got were error messages.
Quote Reply
Re: [PelsLvr] Search Results In reply to
Did you create the additional templates: search_default.html, search_auto.html, etc.?

It won't work if you don't create new ones.
Quote Reply
Re: [PelsLvr] Search Results In reply to
Also, what error messages did you get?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Results In reply to
Ok. I have redone it a 20x and I still cant get it to function. No error messages like yesterday that caused the error stacking/bugging thing.

But today all it will do is list my search_default.html it doesn't show my search_dust.html page when my keyword is "dust" is searched. It just takes me back to my search page.

Quote Reply
Re: [PelsLvr] Search Results In reply to
At the very end put:

<%else%>
Query was: '<%query%>' -- displaying default.
<%include search_default.html%>
<%endif%>

and see what query was and why it didn't match.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Results In reply to
In Reply To:

You could do this in your search_results template:

Code:
<%if query like 'automobiles'%>
<%include search_auto.html%>
<%elsif query like 'computers'%>
<%include search_computers.html%>
..
<%else%>
<%include search_default.html%>
<%endif%>

The only problem I see with this, is that it is case sensitive. If someone types "Automobiles" instead of "automobiles", it doesn't work.

Sean
Quote Reply
Re: [Alex] Search Results In reply to
Alex this still doesnt work for me please tell me exactly where & how to put it in the page.

also is it possible (once it works) to make several keywords pull up the same page?

Like auto, automoblie, car, motor all to load automoblie.html

ie. eye, nose, lip, cheek all to load face.html?

thanks
Quote Reply
Re: [fabio] Search Results In reply to
I GOT IT TO WORK!!! YAHHHHHH

Okay one last help needed on this topic.

How do I make several keywords all go to 1
search template??
Quote Reply
Re: [PelsLvr] Search Results In reply to
ALex??? you said you would answer me via the forum and have not response yet.....

Please tell me how to make auto, car, automoblie all pull up automoblie.html in the search function??
Quote Reply
Re: [PelsLvr] Search Results In reply to
Doesn't the 'elsif' statement work?


<%if query like 'automobiles'%>
<%include search_auto.html%>
<%elsif query like 'computers'%>
<%include search_auto.html%>

etc., etc.


Quote Reply
Re: [BryanL] Search Results In reply to
yes but I will have 100x more scripting on the page than necessary.

there must be a away so that (example)
<%if query like 'automobiles''car''cart'hot rod'%>
<%include search_auto.html%>
<%elsif query like 'computers''harddrive''memory'%>
<%include search_comp.html%>

and NOT have to make it like
<%if query like 'automobiles'%>
<%include search_auto.html%>
<%elsif query like 'car'%>
<%include search_auto.html%>
<%elsif query like 'cart'%>
<%include search_auto.html%>
<%elsif query like 'hot rod'%>
<%include search_auto.html%>

As you can see this would rapidly become alot
of script to put on the page.

Quote Reply
Re: [PelsLvr] Search Results In reply to
Hi,

Your going to need to use a global to do what you want.

Code:
custom_header => sub {
my $tags = shift;
my $query = $tags->{query};
my $file = 'default.html';
if ($query =~ /...../) {
$file = 'foo.html';
}
...
open (FH, "< /path/to/$file");
read (FH, my $text, -s FH);
close FH;
return $text;
}

It may take some more customizations..

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [SeanP] Search Results In reply to
In using this script it is now loading the NEW search results page customized to the keyword search and the default one - how do I get it to load only the 1 page not both??
> >