App wide template filters using Mako

2007-07-14 Thread Scott Benjamin
I'm using mako for my templating language and I noticed it has support for filters, but what I would like to do with it is have a file that contains all of my filters, and then just use them in the templates as needed. Consolidating the template filters into one file seems simpler as I don't keep

Re: App wide template filters using Mako

2007-07-16 Thread jose
I think this is what you need <%! import myfilters %> Heres some tagged text: ${"text" | myfilters.tagfilter} Jose On Jul 14, 6:19 am, Scott Benjamin <[EMAIL PROTECTED]> wrote: > I'm using mako for my templating language and I noticed it has support > for filters, but what I would like to

Re: App wide template filters using Mako

2007-07-16 Thread Scott Benjamin
Does that then mean that I must <%! import myfilters %> in every template file? Surely there is a way to put it in one inherited template? Scott On Jul 17, 6:08 am, jose <[EMAIL PROTECTED]> wrote: > I think this is what you need > > <%! > import myfilters > %> > > Heres some tagged te

Re: App wide template filters using Mako

2007-07-16 Thread Dan Korostelev
There's a "mako.imports" template option for mako. In the times of Myghty there was a setup that added additional "escapes" to Myghty in config/environment.py, I ported it to Mako and use in my projects like this: tmpl_options['mako.imports'] = ['from webhelpers import auto_link as l',