in reply to
Template Toolkit, Default and Zero
did i over simplify, or does this work for you?
[% x = f( z == 1 ? 0 : 1 ) %]
[download]
Also note that besides the ternary operator you can also use the "reverse" condition syntax, just like perl... e.g.
[$ SET n = 0 IF z = 1 %]
is valid TT syntax.
Comment on
Re: Template Toolkit, Default and Zero
Select
or
Download
Code
In Section
Seekers of Perl Wisdom