[Templates] Filtering SSI output through Template-Toolkit

Ross Thomas ross@grinfinity.com
Thu, 23 Oct 2003 18:26:08 -0400


> I'm not quite following.  You want him to replace all his SSI tags
with
> TT?

Not replace, but augment. For example:

<body>
<!--#include virtual="header.inc"-->
<p>The hostname of this system is [% hostname %].</p>
<!--#include virtual="footer.inc"-->
</body>

In turn, header.inc could contain:

<h1>[% page_title %]</h1>

That's obviously contrived, but I think you can see what I mean. It
allows him to work within his GUI software and see the complete page
(since it recognizes SSI include directives and pulls in a read-only
version of the included file), and yet retain the benefits of using
TT. Obviously I'll need to define $hostname and $page_title somewhere.
One idea is to simply call from within the handler a package function
with a name derived from the currently processing .shtml file.

> Post-filtering implies that there will be some SSI stuff that gets
> resolved and then results in a document that contains TT tags.

Right. This is precisely what I need. I'm going to check some of the
other SSI modules on CPAN now :).

-- Ross