List Info

Thread: Storing output from INCLUDE or PROCESS




Storing output from INCLUDE or PROCESS
user name
2006-06-06 18:01:46
I am wondering if there is a way to store the output from
INCLUDE or PROCESS 
into a variable.  

I'd like to do something like this:

[% var = PROCESS somefile1 %]
[% IF var %]
[% PROCESS somefile0 %]
[% var %]
[% ELSE %]
[% PROCESS somefile2 %]
[% END %]

Thanks!

-James

_______________________________________________
templates mailing list
templatestemplate-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/t
emplates
Storing output from INCLUDE or PROCESS
user name
2006-06-06 18:32:09
This would probably work:
[% var = BLOCK %][% PROCESS somefile1 %][% END %]

-- Josh

James Lance wrote:
> I am wondering if there is a way to store the output
from INCLUDE or PROCESS 
> into a variable.  
> 
> I'd like to do something like this:
> 
> [% var = PROCESS somefile1 %]
> [% IF var %]
> [% PROCESS somefile0 %]
> [% var %]
> [% ELSE %]
> [% PROCESS somefile2 %]
> [% END %]
> 
> Thanks!
> 
> -James
> 
> _______________________________________________
> templates mailing list
> templatestemplate-toolkit.org
> http://lists.template-toolkit.org/mailman/listinfo/t
emplates


_______________________________________________
templates mailing list
templatestemplate-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/t
emplates
Storing output from INCLUDE or PROCESS
user name
2006-06-06 19:11:06
James Lance wrote:
> I am wondering if there is a way to store the output
from INCLUDE or PROCESS 
> into a variable.  
> 
> I'd like to do something like this:
> 
> [% var = PROCESS somefile1 %]

That'll do it.

You can assign the output of any (well, most) directive
straight to a 
variable.

A


_______________________________________________
templates mailing list
templatestemplate-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/t
emplates
[1-3]

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