Hey,
i posted this issue on the mailingliste, but I didn't get any response. I am not sure wether I understand all ideas behind twig but I think this is a bug:
I tried the following and it doesn't work the way I wanted it to work:
{% if type == 0 %}
{% block menuHandbooks %}currentmenu{% endblock %}
{% endif %}
{% if type == 1 %}
{% block menuDocuments %}currentmenu{% endblock %}
{% endif %}
{% if type == 2 %}
{% block menuBetProgram %}currentmenu{% endblock %}
{% endif %}
Is it intended, that all conditions are true? I had a template which was inherited {% extends '::admin.html.twig' %}
and with the above example, the template gets his own body.
The idea is to mark the current page in the menu.
I rebuild it this way and now it works:
{% block menuHandbooks %}
{% if type == 0 %}currentmenu{% endif %}
{% endblock %}
{% block menuDocuments %}
{% if type == 1 %}currentmenu{% endif %}
{% endblock %}
{% block menuBetProgram %}
{% if type == 2 %}currentmenu{% endif %}
{% endblock %}
Best regards
Fabian
P.S. Part from the admin.html.twig:
Nachrichten
Dokumente
Handbücher
Lernvideos
Hey,
i posted this issue on the mailingliste, but I didn't get any response. I am not sure wether I understand all ideas behind twig but I think this is a bug:
I tried the following and it doesn't work the way I wanted it to work:
{% if type == 0 %}
{% block menuHandbooks %}currentmenu{% endblock %}
{% endif %}
{% if type == 1 %}
{% block menuDocuments %}currentmenu{% endblock %}
{% endif %}
{% if type == 2 %}
{% block menuBetProgram %}currentmenu{% endblock %}
{% endif %}
Is it intended, that all conditions are true? I had a template which was inherited {% extends '::admin.html.twig' %}
and with the above example, the template gets his own body.
The idea is to mark the current page in the menu.
I rebuild it this way and now it works:
{% block menuHandbooks %}
{% if type == 0 %}currentmenu{% endif %}
{% endblock %}
{% block menuDocuments %}
{% if type == 1 %}currentmenu{% endif %}
{% endblock %}
{% block menuBetProgram %}
{% if type == 2 %}currentmenu{% endif %}
{% endblock %}
Best regards
Fabian
P.S. Part from the admin.html.twig: