Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Headers/Footers for Keyword Searches.

Quote Reply
Headers/Footers for Keyword Searches.
Someone has probably already thought of this before, but it would be nice to have an option to display different headers/footers based on the search term that someone uses. Maybe a separate definition file could be created that listed the search terms and the appropriate header/footer files to be displayed.

The search engine would have to be pretty popular for this to be very useful, but it would be a nice feature regardless. =)



Rob Bartlett
AAA Internet Publishing, Inc.
http://www.AAAInternet.com
Quote Reply
Re: Headers/Footers for Keyword Searches. In reply to
You could just add this code to search_results.html

<%if query eq 'yourword'%>
<%include header.txt%>
<%endif%>


Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Headers/Footers for Keyword Searches. In reply to
That is a pretty simple solution, but I can see the search-results template file getting awfully large if lots of different keywords are getting targeted. =)

Rob Bartlett
AAA Internet Publishing, Inc.
http://www.AAAInternet.com
Quote Reply
Re: Headers/Footers for Keyword Searches. In reply to
Yeah I know...It was just a temporary solution.

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Headers/Footers for Keyword Searches. In reply to
This would really be an extension of the banner system, which is keyword targetable.

The documentation on the template tags is not complete, but you should be able to load/import files based on passed parameters, either directly, or by using the sub {} method of functions.

This should be fleshed out in the next few weeks as the final version approaches.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Headers/Footers for Keyword Searches. In reply to
Hi,

Pugdog is right, this is simply a matter of adding your own code through template globals:

Add a tag search_header with contents:

sub {
my $tags = shift;
my $query = $tags->{query};
if ($query =~ /foo/) { return "something" }
elsif ($query =~ /bar/) { return "something else" }
...
}

or however you want to map search terms => output.

Cheers,

Alex

--
Gossamer Threads Inc.