First, let me start with the code I'm attempting to use:
{% if modal == true %}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% endif %}
What I'm trying to accomplish is to not show my header and footer blocks ONLY if the variable called modal is true. I also have this below the if statement:
{% block content %}
{{ dump(modal) }}
{% endblock %}
What happens here is that my override for emptying the header and footer blocks always runs regardless of if the value of modal is true or otherwise. So, I run this with modal passed in as false and the result is that the header and footer still don't show. The output of the dump command accurately shows true or false, but the condition always seems to evaluate to true in the if statement.
Can blocks not be wrapped in a conditional statement, or is there something additional I need to do to make this work?
Thanks for any help you can offer.