Hi Joel --

> I'm working on a web site that will be a combination of static pages and
> application pages, and I'd like to use cgiapp to build the static
> pages.  I've been browsing the archives, and can't find any real answers.
> 
> Should I be considering a separate utility or CMS based on HTML::Template?

Stepping back a bit:  Why do you want CGI-App to build static pages?
 
Possible reasons that come to my mind:
* You're trying to implement site-wide login security.
* You have global parts (navigation, etc.) which you want included in each page.
 
In the first case, if you have the means I would strongly recommend you use an Apache 
module-based auth system, instead of putting your security into your application.  
This will protect all documents, othogonally to the content served.
 
In the second case, you could use simple server-side includes.  However, I can see the 
benefit of using one template system throughout.  If this is your goal, then this 
isn't really a CGI-App question so much as a question for your templating system.  If 
you're using HTML::Template (the default template engine for CGI-App) I would 
recommend writing an Apache module which handles any file in htdocs which ends ".tmpl".
 
If you do not have the means to write an Apache module, that is when you need a 
"script" to drive your template engine.  Some other people have referred to such a 
script for Template-Toolkit.  I've never seen it before, but writing such a script for 
HTML::Template should be trivial.  You could use CGI::Application, or you could do 
something even more low-level.  All the script has to do is to is to look at the 
requested URI, load the appropriate template file, and populate it with the 
appropriate data.
 
TTYL,
 
-Jesse-
 

Reply via email to