Re: [Templates] Interpolating tags within tags

[prev] [thread] [next] [Date index for 2004/08/23]

From: Chris Ochs
Subject: Re: [Templates] Interpolating tags within tags
Date: 17:25 on 23 Aug 2004
>
> Harry> [% var1 | eval %]
>
> Of course, this prevents the caching of the template-to-Perl
> translation, so this should be the "avoid at all cost" solution.
> Better would be to find a way to push that stuff into a file in the
> INCLUDE path to permit it to be treated as normal text.
>
> Hmm.  Template::Plugin::CachedEval, anyone? :)

Just an example of why we can't just put it in a file.  We have a number of
template libraries for our clients, such as an order page template library.
There are a limited number of configuration options that we want to store in
template variables, but we dont' want our clients to have to edit template
pages directly just for these few variables.  So I have a function that
stores the variables in a cache(memcache) backed by a database (values
frozen with Storable), and the header page thaws them out and sticks them
into a template hash.  Most clients don't get enough traffic where the
performance is an issue, and it if is then it's easy to just stick them
directly into the header file on a case by case basis.  For 95% of our
clients though it's much easier to just have a web page where they enter the
configuration variables and not have to worry about editing template pages
at all.

Chris


>
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>
> _______________________________________________
> templates mailing list
> templates@xxxxxxxxxxxxxxxx.xxx
> http://lists.template-toolkit.org/mailman/listinfo/templates
>


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Interpolating tags within tags
Chris Ochs 16:15 on 23 Aug 2004

Re: [Templates] Interpolating tags within tags
Harry Jackson 16:28 on 23 Aug 2004

Re: [Templates] Interpolating tags within tags
merlyn (Randal L. Schwartz) 16:59 on 23 Aug 2004

Re: [Templates] Interpolating tags within tags
Chris Ochs 17:25 on 23 Aug 2004

Re: [Templates] Interpolating tags within tags
Axel Gerstmair 18:15 on 23 Aug 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52