Skip to main content.
home | support | download

Back to List Archive

Re: [Ignor Abuse] Re: How to use 'user-config' in search.cgi using SWISH::API

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Wed May 05 2004 - 15:44:44 GMT
On Wed, May 05, 2004 at 04:48:00PM +0200, Peter Morling wrote:
> I found the problem:
> 
> in search.cgi you have two entry points (about line 50):

Oh, you are right.  Thanks.

Can you test by changing it to:

 process_request() unless $ENV{MOD_PERL};

and see if that also fixes it?  The script is suppose to be able to run
under mod_perl or CGI.


> But the following problems:
> 
> - to configure max_chars  # Limits the size of the description_prop

In the search.cgi example max_chars is not used.  In the template:

   [% item.Property('swishdescription') || "No description" | highlight('swishdefault') %]

is suppose to filter the property and limit the description based on the
settings at the top of the program.


> 
> - to change the things defined in
> SWISH-E\share\doc\swish-e\example\searct.tt to work with 'search.cgi'
> especially:

search.tt is not suppose to work with search.cgi.  The template located
in search.cgi is suppose to work with search.cgi.  Copy that template to
a file and use that at a starting point.


> 
> ----
>     [% FOR page = search.page_array %]
>         [% IF page.cur_page %]
>             <font size="-1" face="Arial, Helvetica, San-Serif">
>             <b>[% page.page_number %]</b>&nbsp;
>             </font>
>         [% ELSE %]
>             <font size="-1" face="Arial, Helvetica, San-Serif">
>             <a style="text-decoration:none" href="[% search.query_href
> %];start=[% page.page_start %]"><u>[% page.page_number %]</u></a>&nbsp;
>             </font>
>         [% END %]
>     [% END %]
> ----
> 
> it seems that i can not refer to the 'search.page_array' but maby I can find
> out from looking in 'swish.cgi'??

It works like this:  The program (search.cgi or swish.cgi) set up data
structures and pass those to the template.  The template can only use
what's provided to it by the program.  So you can't use a template from
swish.cgi (i.e. search.tt) with search.cgi.

It's very unfortunate the way I named those files.  search.tt was
around long before search.cgi.  search.tt should have been named
swish.tt.  Maybe it should be renamed with a big fat warning the the
CHANGES file.

-- 
Bill Moseley
moseley@hank.org
Received on Wed May 5 08:44:45 2004