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

external search template

Quote Reply
external search template
How do I script a search box for other sites and get it to call the results branded with a dynamic template.

Quote Reply
Re: external search template In reply to
Hi,

create a form with the action="your-url/cgi-bin/search.cgi"
add an hidden input name="ex_search" value="1"

add a new subroutine externalsearch to html-templates.pm
(copy the one which builds the searchresults)

edit search.cgi to look if the param ex_search is 1
and then either call your original template or the new one.

:)

Regards,
Alexander


Quote Reply
Re: external search template In reply to
If you use the same search_results.html template, file you can easily add custom tags for "affiliate" partners or external sites, by adding hidden field parameters (after defining the tags as Alex has already recommended):

Code:

<input type="hidden" name="ext_logo" value="ENTER URL OF LOGO">
<input type="hidden" name="ext_url" value="ENTER URL OF WEB SITE ADDRESS">
<input type="hidden" name="ext_title" value="ENTER TITLE OF WEB SITE">


Then in the search_results.html template file, add the following tags:

Code:

<%if ext_logo%>
<%ext_logo%>
<%endif%>
<%ifnot ext_logo%>
<%include header.txt%>
<%endif%>


Then later in the file:

Code:

<%if ext_url%>
<%if ext_title%>
<a href="<%ext_url%>"><%ext_title%></a>
<%endif%>
<a href="<%ext_url%>">Previous Page</a>
<%endif%>


And to find out more about external search forms, search the support forums for External Search Forms and you will find a lot of Threads where this has been discussed before.

BTW: I have this working in my LINKS SQL v.1.13 site:

http://vlib.anthrotech.com/search/searchform.shtml

Good luck!

Regards,

Eliot Lee