Monday, September 29, 2014

templates: if and static tags incompatible?

Hello,

I've got a small problem:

here is the code in my template:

{% if p.fleches %}
<A HREF=#haut><img alt='haut-up' src="{% static "images/fleche-haut.jpg" %}" ></A>
{% endif %}

and the django development server tells me:

Django Version: 1.4.5
Exception Type: TemplateSyntaxError
Exception Value:
Invalid block tag: 'static', expected 'elif', 'else' or 'endif'

Is it a bug, or is it really impossible to put a static tag inside an if tag?

Thanks in advance!


No comments:

Post a Comment