I am trying to pass a template into a cut filter, something like this
{{ myVariable|cut:"something + templateVariable" }}
I’ve tried:
{{ myVariable|cut:"something"|add:templateVariable }}
and
{{ myVariable|cut:"something {{ templateVariable }}" }}
but these does not work.
Is this possible to do?
It should work with a temporary variable using the with tag:
Or in Django 1.2 and older:
Add does not support concatenation of string and int but you could easily make a template filter that converts to string for example:
Would allow a such template tag expression
some_int|to_unicode|add:'foo'.