{%- do gantry.debugger.startTimer('render', 'Rendering page') %} {%- do gantry.theme.setLayout() -%} {%- do gantry.theme.loadAtoms() -%} {%- set segments = gantry.theme.segments() -%} {%- set content %} {% if gantry.theme.hasContent() %} {% block content %} {% endblock %} {% endif %} {% endset -%} {%- set offcanvas = null -%} {%- for segment in segments if segment.type == 'offcanvas' %} {%- set offcanvas = segment -%} {% endfor -%} {%- set page_offcanvas %} {% block page_offcanvas %} {% if offcanvas %} {% include '@nucleus/layout/' ~ offcanvas.type ~ '.html.twig' with { 'segment': offcanvas } -%} {% endif %} {% endblock %} {% endset -%} {%- set page_offcanvas = page_offcanvas|trim ?: '' %} {%- set offcanvas_position = page_offcanvas ? offcanvas.attributes.position|default('g-offcanvas-left') : '' -%} {%- set page_layout %} {% block page_layout %} {% for segment in segments if segment.type != 'offcanvas' %} {% include '@nucleus/layout/' ~ segment.type ~ '.html.twig' with { 'segments': segment.children } %} {% endfor %} {% endblock %} {% endset -%} {%- set page_top %} {% block page_top %} {% endblock %} {{ gantry.document.getHtml('top')|join("\n ")|raw }} {% endset -%} {%- set page_bottom %} {% block page_bottom %} {% endblock %} {{ gantry.document.getHtml('bottom')|join("\n ")|raw }} {% endset -%} {%- set body_top %} {% block body_top %} {% endblock %} {{ gantry.document.getHtml('body_top')|join("\n ")|raw }} {% endset -%} {%- set body_bottom %} {% block body_bottom %} {% endblock %} {{ gantry.document.getHtml('body_bottom')|join("\n ")|raw }} {% endset -%} {%- do gantry.document.addScript(url('gantry-assets://js/main.js'), 11, 'footer') -%} {# Head and footer needs to come last because of any of the above blocks may have CSS or JavaScript in them #} {%- set page_head %} {% block page_head -%} {% include 'partials/page_head.html.twig' %} {%- endblock %} {% endset -%} {%- set page_footer %} {% block page_footer %} {% do gantry.platform.finalize() -%} {{ gantry.scripts('footer')|join("\n ")|raw -}} {% endblock %} {{ gantry.debugger.render()|raw }} {% endset -%} {%- block page -%} {{ page_head|raw }} {% block page_body -%}
{{ gantry.config.page.body.body_top|raw }} {{ body_top|raw }} {{ page_offcanvas|raw }}