{% extends "Flow/base.html" %}
{% if no_tracking %}
{% block head %}
{% include "Flow/common/tracking/disabled.html" %}
{% endblock %}
{% endif %}
The snippet of code aboves overrides the head block in base.html, even though no_tracking is False. How can I make this behavior conditional?
I thought of this:
{% block head %}
{% if no_tracking %}
{% include "Flow/common/tracking/disabled.html" %}
{% else %}
<!-- How can I get "head" of base.html here? -->
{% endif %}
{% endblock %}
But this would also override the head of base.html.
head of base.html is not empty, it contains scripts that must be on the page when no_tracking is False.
I could override them in base.html, but base.html has no concept of no_tracking since that is a context variable passed to the view being rendered and not the one it extends.
How can I solve this?