alex wrote:
> Now I don't understand the effect of the EXPOSE_BLOCKS option you
> mention.  When I do this:
> 
>   [% PROCESS Playlouder/docs/include/fancy_blocks %]
>   [% INCLUDE blue_fish %]
> 
> and fancy_blocks contains this:
> 
>  [% BLOCK blue_fish %]BLUE FISHES[% END %]
> 
> The block is included, regardless of whether EXPOSE_BLOCKS is set.

[...]

>  but I'm not sure how the EXPOSE_BLOCKS option works, and how it could 
> help me in this case.

With EXPOSE_BLOCKS set, you can do this:

   [% PROCESS Playlouder/docs/include/fancy_blocks/blue_fish %]

You can access blocks defined within other templates directly without
having to first PROCESS the template to load them in.

BTW, the fact that INCLUDE doesn't export template BLOCKs is intentional,
for the same reason it doesn't export variables defined - PROCESS templates 
can modify the caller but INCLUDE templates generally don't.

> So...  I want to be able to ask a view object to PROCESS a template (or
> block) rather than INCLUDE it.  

Ah right, I see.  There isn't a method for doing PROCESS rather than 
INCLUDE, but you can use the template() method to fetch the template 
which you then pass to PROCESS.   Just use a '$' prefix to tell TT 
the PROCESS argument is a variable to be evaluated, not a literal 
template name.

  [% PROCESS $view.template('header') %]

But if you use the EXPOSE_BLOCKS option, this probably won't be necessary.

HTH

A


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to