[cgiapp] Custom template tags

Michael De Soto mailman at quarghost.com
Tue Oct 12 09:41:01 EDT 2010


I know HTML::Template is unrelated to CGI::Application, but since both are
routinely bundled and used together I thought that I'd ask your opinions
about custom template tag syntax. So bear with me:

I'm trying to integrate an install of Movable Type with a C::A application.
Rather than attempting to write plug-ins to MT, I found that I can create
and maintain my templates within MT (when published statically obviously),
and have my C::A app consume them. This works nearly perfectly with the
exception of template tag syntax. The standard <TMPL_VAR> syntax doesn't
work because it is stripped out by MT (presumably because they also use
HTML::Template). I can use <!-- TMPL_VAR --> to be consumed by my C::A and
everything works fine -- but I hate the way those extra characters clutter
my templates and they are easy to confuse with regular real HTML comments.
It's a small issue to be sure, but I recall reading somewhere that I could
override HTML::Template's handling of template tags by using a regex. I
remember reading a tutorial on it, but now I can't find anywhere. I thought
it was on the CGI::App website, but I didn't see it the last time I looked.

So: Has anybody done this with or without MT being in the mix? Does anybody
have a link to that tutorial? Anybody have any advice on how to achieve
this?

Thanks,


Michael De Soto


More information about the cgiapp mailing list