2014-02-06

Template Toolkit Multiple Filters (chaining filters)

This one is very simple, but not obvious as first...

I tried [% user.firstname FILTER lower,ucfirst %] but my output was lower only.  The solution:
[% user.firstname FILTER lower FILTER ucfirst %].

There is also a short hand version:
[% user.firstname | lower | ucfirst %].

Note that filters are processed left to right so [% user.firstname FILTER ucfirst FILTER lower %] would produce only lowercase output.