hopefully this will be my last point of confusion.
In my Smarty templates I have what equates to the twig code below which sets the 'heading' block conditionally depending on what 'show' is set to. The template code I have inserted below doesn't work, it gives an error saying that the heading block is already defined. I did some research and I figured out that this doesn't work with Twig, I guess because it is compiling it before it is checking the if statement which to me is totally counter intuitive but I didn't create Twig. =)
{% if show is defined %}
{% if show == 'add_form' %}
{% block heading %}Add{% endblock %}
{% elseif show == 'main' %}
{% block heading %}Main{% endblock %}
{% endif %}
I only use this style in templates where there are a bunch of very tiny views (literally 2-3 lines of HTML) so I suppose that I could just make separate template files for each of them but that just seems like a ton of extra files. What is the "right" way to do this in Twig?
Thanks again