Skip to main content.
home | support | download

Back to List Archive

Re: SSI's and Swish.cgi

From: Bill Moseley <moseley(at)>
Date: Thu Apr 15 2004 - 17:21:17 GMT
On Thu, Apr 15, 2004 at 09:48:32AM -0700, Phil Matt wrote:
> Is it possible to call an SSI from within Swish.cgi? I am trying to insert a site menu on the 
> results page that Swish.cgi generates.

Not that I'm aware of.  When running CGI script you are using mod_cgi,
and when running ssi you are using apache's mod_include.  Probably need
Apache 2.0's filters to chain the two handlers together.

There's some tricks.  I think you can include a CGI program inside a ssi
page with <!--#include virtual="/path/to/program" --> or <!--# exec
cgi=...> but I'm not sure what kind of environment is provided, and
won't work with swish.cgi that expects to be its own CGI script and
output headers and all the content.  So I would avoid that.

A google search might find some solutions.

There's also a Perl module called CGI::SSI that is suppose to filter SSI
through a CGI script.  Again, not a great solution.

The bottom line is SSI is very limited, which is why people use
templating solutions like Template-Toolkit.  TT is nice because you can
use the same set of templates to generate static files and also for use
in CGI scripts and mod_perl applications.

And on a somewhat related note, here's some light reading:

If you plan on including a database application in your site at some
point here's an article that shows using Template-Toolkit and Class::DBI
to make things really clean and easy.

So if you were already using TT for static page generation and for your
CGI scripts, then you would be set to include a data base application.

Bill Moseley
Received on Thu Apr 15 10:21:17 2004