Comment 2 for bug 394011

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote : Re: [Bug 394011] [NEW] enable the use string: ${foo | nothing} to avoid a KeyError

On Tue, Jun 30, 2009 at 5:16 PM, Malthe<email address hidden> wrote:
> 2009/6/30 Edwin Grubbs <email address hidden>:
>>  <span tal:content="string: Hello, ${foo | nothing}">
>
> This would yield:
>
> <span>Hello, </span>
>
> Can't you do:
>
> <span tal:content="string: Hello, ${foo} | string:">

I guess my example was too simple to explain the problem I am having.
Here is a better one.

<script tal:content="string: do_something('${foo}', '${bar}', '${baz}')" />

As you can see, I would have to have an alternate string for each
combination of variables that could be undefined.

-Edwin