Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Simple "Return Link" on Seacrh results page mod

Quote Reply
Simple "Return Link" on Seacrh results page mod
This is a simple mod that will add "Return To" link on your search results page. For use if you have other sites showing your search box, it will show the referring site's return link on your results page.

IN sub site_html_search_results of HTML_Templates.pm

ADD
my $refer_url;
$refer_url = $ENV{'HTTP_REFERER'} if !($ENV{'HTTP_REFERER'} =~ /$LINKS{build_root_url}/i);

CHANGE
print &load_template ('search_results.html', {
%$tags,
%globals
});

TO
print &load_template ('search_results.html', {
refer_url => $refer_url,
%$tags,
%globals
});

IN TEMPLATE search_result.html
ADD
<%if refer_url%>
Return to <a href="<%refer_url%>"><%refer_url%></a>
<%endif%>

DONE!