Is there a way to pass the result of a template tag to another template tag?
I have 2 custom template tag as following:
@register.simple_tag
def foo():
return foo_value
@register.simple_tag
def bar(value):
return bar_value + value
and I want to to use them in my template like this:
{% load my_custom_tags %}
{% bar foo %}
I also use {% with %} block but failed.
Yes, you can use an as expression part in a template tag to store the result in a variable. For example:
{% load my_custom_tags %}
{% foo as foo_result %}
{% bar foo_result %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With