How do I script a search box for other sites and get it to call the results branded with a dynamic template.
Jan 8, 2001, 6:00 AM
User (179 posts)
Jan 8, 2001, 6:00 AM
Post #2 of 3
Views: 3611
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
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
Jan 8, 2001, 9:25 AM
Veteran (17240 posts)
Jan 8, 2001, 9:25 AM
Post #3 of 3
Views: 3598
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):
<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:
<%if ext_logo%>
<%ext_logo%>
<%endif%>
<%ifnot ext_logo%>
<%include header.txt%>
<%endif%>
Then later in the file:
<%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
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