Skip to main content.
home | support | download

Back to List Archive

cgi question/template questions

From: Aaron Bazar <yeranb(at)not-real.yahoo.com>
Date: Thu Jun 26 2003 - 15:01:25 GMT
Hi Everybody!

If this question is a repeat, I apologize. It seems I am having some trouble
sending email to the list.


I have a small problem. I would like to add a bit of functionality to the
cgi script, but I am not quite sure where to do it.

I would like to take the query string that somebody enters during a search,
and use that string to generate a listing of related keywords, and then
print that out in the results. However, with the use of the templates, etc,
I can't quite figure out how to go about it (my knowledge of object oriented
perl is also VERY limited).

Right now, I have a piece of script that generates a random set of keywords
from list that I have. I put this small snippet of code right in the "
TemplateHTMLTemplate.pm" file, below the "ugly hack" line. The list of
keywords is pulled from the file, and set to a variable, that I have added
to the list of $params. ( MENU        => $menuInfo) ... So, in the
swish.tmpl file, I have a template variable called MENU that the list gets
put into automatically. It works fine, even if it is a really ugly hack, but
I can't figure out how to get query_simple into the program...


In the list of $params, I see "QUERY_SIMPLE    => CGI::escapeHTML(
$results->{query_simple}"

How can I make that variable or data available at the top of the program so
I can use it to make a RELATED keywords tag, (or replace the MENU tag, I
have already created). I suspect this is an easy question for somebody who
understands OO perl... I need to avoid the errors I have gotten before,
though... variable XXX needs explicit package name, etc. etc...




Thanks for you help and suggestions!


Aaron Bazar
Received on Thu Jun 26 15:01:36 2003