Der Inhalt von templates/page/layout.html.twig sieht bei mir so aus:
Code:
{% extends "@Contao/page/layout.html.twig" %}
{% block head %}
{{ parent() }}
{% add "glightbox_css" to head %}
<link rel="stylesheet" href="{{ asset('bundles/contaoglightbox/css/glightbox.min.css') }}">
{% endadd %}
{% add "theme_css" to head %}
<link rel="stylesheet" href="{{ asset('files/theme/next/css/styles.min.css') }}">
{% endadd %}
{% endblock %}
{% block body_content %}
{% slot header %}
<header id="header" class="navbar-scrollspy">
<div class="inside">{{ slot() }}</div>
</header>
{% endslot %}
{% slot main %}
<div id="container">
<main>
<div class="inside">{{ slot() }}</div>
</main>
</div>
{% endslot %}
{% slot footer %}
<footer id="footer">
<div class="inside">{{ slot() }}</div>
</footer>
{% endslot %}
{% endblock %}
{% block end_of_body %}
{# GLightbox Script #}
{% add "glightbox_js" to body %}
<script src="{{ asset('bundles/contaoglightbox/js/glightbox.min.js') }}" defer></script>
{% endadd %}
{# Scrollspy Script #}
{% add "scrollspy" to body %}
<script src="{{ asset('files/theme/next/js/scrollspy.js') }}" defer></script>
{% endadd %}
{# GLightbox initialisieren #}
{% add "glightbox_init" to body %}
<script>
document.addEventListener('DOMContentLoaded', function () {
if (typeof GLightbox !== 'function') return;
GLightbox({ selector: 'a[data-lightbox]' });
});
</script>
{% endadd %}
{{ parent() }}
{% endblock %}