I want to override a block of my template extension within a included file.
{# base.twig#}
<html>
{% block script %}
...
{% endblock %}
</html>
{# pageOne.twig #}
{% extends "base.twig" %}
...
{% include "searchbar.twig" %}
{# searchbar.twig #}
...
{% block script %}
{{ parent() }}
<script>alert("searchbar is ready!");</script>
{% endblock %}
I need to use the JavaScript files, that i include in the base.twig
. I already tried to use embed
instead of include
. But this also did'nt work.