Re: [Templates] Assigning chained filter output to variable?
[prev]
[thread]
[next]
[Date index for 2004/06/04]
On Fri, Jun 04, 2004 at 04:29:22PM -0400, darren chamberlain wrote:
> * Jesse Sheidlower <jester at panix.com> [2004/06/04 16:23]:
> > I can do something like
> >
> > [% title = FILTER html; raw_title; END %]
> >
> > but suppose I'd like to take "raw_title" and chain it through:
> >
> > FILTER replace('<title>','<i>') | replace('</title>','</i>') | html
> >
> > but assign the whole lot to "title". Is there a way to do this
> > by chaining, i.e. without having several separate filter statements?
>
> What's wrong with several FILTERs?
>
> $ tpage
> [% raw_title = '<title>foo</title>' %]
> [% title = raw_title | replace('<title>', '<i>') | replace('</title>', '</i>') | html %]
[...]
Er, aside from the fact that when I tried several variants of this, it didn't
work, nothing.
I guess I just missed the right one.
Thank you.
Jesse Sheidlower
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates