Hi community,
i have inline javascript in a view which should be loaded in the footer for performance reasons. Same with css-style which should come to the header. How can this be implemented? Should I use blocks? I load the views by the {{ content() }} call and I currently do not use blocks views.
My first try is to define a block in the main index.volt and in the views I do the following:
<body>
{%block js_footer %}
alert("This code should be in the footer not in the middle of the content!");
{%endblock %}
<h1>Html HTML HTML HTML</h1>
The Output:
<body>
<h1>Html HTML HTML HTML</h1>
<script type="text/javascript>
alert("This code should be in the footer not in the middle of the content!");
</script>
But I get the error "Embedding blocks into other blocks is not supported"
greetings Eike