help with custom tag plus custom filter

2006-01-21 Thread imbunche
Hi, I have a tag (called imgpath) which creates the renders the tag with the image passed as argument and verifies the file exists or provides some defaults ... that works fine. Notice that the argument to {%imgpath%} can be a template variable, e.g. {% imgpath {{baseurl}}/images/{{myimage}} %}

Re: help with custom tag plus custom filter

2006-01-21 Thread Adrian Holovaty
On 1/21/06, imbunche <[EMAIL PROTECTED]> wrote: > The custom filter and the custom tag mentioned above work fine by > themselves, it also works if I use any standard filter like upper or > lower but if I use: > > {% imgpath {{myimg | thumb}} %} The syntax is slightly off in that example. You'll w

Re: help with custom tag plus custom filter

2006-01-21 Thread imbunche
Thanks for your reply, that means my tag implementation is wrong :-( ... Then, how can I resolve the variable name inside the tag implementation?? I'd like to invoke the tag like: {% imgpath /static/images/ %} ... and are variables. It looks like it can not be supported ... I hope I'm wrong.

Re: help with custom tag plus custom filter

2006-01-22 Thread akaihola
I don't see why you couldn't use compile_string (from django.core.template) or your own parser to resolve variables in your template tag. A custom parser might be faster, but then again with compile_string you get more features.

Re: help with custom tag plus custom filter

2006-01-22 Thread imbunche
akaihola wrote: > I don't see why you couldn't use compile_string (from > django.core.template) or your own parser to resolve variables in your > template tag. A custom parser might be faster, but then again with > compile_string you get more features. Using compile_strings {{a}} = 'c' {{d}} = '