Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Setting a Cookie / Printing the header for the Search Results Page

Quote Reply
Setting a Cookie / Printing the header for the Search Results Page
What is the relevant hook to set a cookie / print a header on the search results page?


At the moment, I have tried a simple subroutine, that just prints "Content-type:text/plain". This is then called from each of these hooks:


search_results PRE Plugins::SetCookie::main FIRST
site_html_search_results PRE Plugins::SetCookie::main FIRST
site_html_search_results POST Plugins::SetCookie::main FIRST
search_results POST Plugins::SetCookie::main FIRST



Then, when I run my search results, all I get is

Content-type:text/plain Content-type: text/html Content-type:text/plain Content-type:text/plain

followed by the normal document contents.

{ How do I override the existing header? }

Last edited by:

giovanni: Aug 19, 2002, 12:27 PM
Quote Reply
Re: [giovanni] Setting a Cookie / Printing the header for the Search Results Page In reply to
I have this sorted now, but not via LSQL.
Quote Reply
Re: [giovanni] Setting a Cookie / Printing the header for the Search Results Page In reply to
print $IN->header( your options go in here );

$IN is an GT::CGI object (read the docs for details, also the docs on CGI.pm might help, since GT::CGI is based on CGI).

Hope that helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Setting a Cookie / Printing the header for the Search Results Page In reply to
Hi Yogi,

I did have a long look at the docs, and I did use that method to try and print the header that I wanted. The problem is that I found it difficult to print my header before links_sql printed its header. I couldn't find a hook that came at the right time.

Thanks for your help tho'.
Quote Reply
Re: [giovanni] Setting a Cookie / Printing the header for the Search Results Page In reply to
The search_results hook should be fine, site_html_search_results is not. If you have a look at Links/User/Search.pm you will see that the header is printed after search_results, but before site_html_search_results.

Ivan
-----
Iyengar Yoga Resources / GT Plugins