List Info

Thread: Mason and TT Directives




Mason and TT Directives
user name
2006-12-22 17:50:02
On Dec 22, 2006, at 2:34 AM, Adeola Awoyemi wrote:

> Is there a Template Toolkit version of Mason's
<%init> and  <%once>  
> directives.

I don't think so, but you can use [% PERL %] blocks.

Best,

David
Mason and TT Directives
user name
2006-12-23 06:00:07
On 22 Dec 2006, at 17:50, David E. Wheeler wrote:

> On Dec 22, 2006, at 2:34 AM, Adeola Awoyemi wrote:
>
>> Is there a Template Toolkit version of Mason's
<%init> and  <% 
>> once> directives.
>
> I don't think so, but you can use [% PERL %] blocks.

Does code in the TT [% PERL %] blocks only run once like in
the Mason  
Directives?


Mason and TT Directives
user name
2006-12-23 23:54:06
On Dec 22, 2006, at 10:00 PM, Adeola Awoyemi wrote:

> Does code in the TT [% PERL %] blocks only run once
like in the  
> Mason Directives?

It's like the Mason <%perl> and <%init>
directives, yes, but not like  
<%once>. The <%once> directives are probably
moot for Bricolage  
templates, anyways, because a new interpreter is created
every time  
you publish a story, so they still execute every time you
publish a  
story. Of course, if your story has multiple pages,
<%once> blocks  
evaluate only once, while %perl and %init blocks evaluate
for every  
page.

Best,

David
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )