Reputation: 4714
I can get output on the current page title by doing:
{% block title %}{% endblock %}
However, how can I use this in a conditional? This doesn't seem to work:
{% if title == "Bla" %}
doing some stuff!
{% endif %}
Thanks!
Upvotes: 0
Views: 257
Reputation: 208495
Your current syntax is correct according to the Django docs, double check that title
has the value you think it does.
==
operator
Equality. Example:
{% if somevar == "x" %}
This appears if variable somevar equals the string "x"
{% endif %}
Upvotes: 1