How can I render a block multiple times within a view in a twig template? Currently I do have a block, let's call it something
defined in an included (via render
) twig file. I then include it at the layout-twig file using the following:
{% block something %}{% endblock %}
Everything is fine, however as soon as I call this tag a second time, I get the following error message:
The block 'something ' has already been defined in "::layout.html.twig"
Therefore: How can I render a block multiple times?
The notation you're showing us is for defining and rendering a block. Rendering only is done this way:
{{ block('blockName') }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With