Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deferred blocks #593

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions templates/layouts/layout.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{# we're rendering the content block first to ensure that pimcore_head_* helper calls within all templates used within the content block are executed before the layout gets rendered #}
{% set content %}
{{ block('content') }}
{% endset %}
<!doctype html>
<html lang="{{ app.request.locale }}">
<head>
Expand Down Expand Up @@ -54,8 +58,7 @@
{% set isPortal = ((isPortal is defined) and isPortal) %}
{% endapply %}

{# we're using the deferred extension here to make sure this block is rendered after all helper calls #}
{% block layout_head_meta deferred %}
{% block layout_head_meta %}
{{ pimcore_head_title() }}
{{ pimcore_head_meta() }}

Expand All @@ -65,7 +68,7 @@

{% endblock %}

{% block head_stylesheets deferred %}
{% block head_stylesheets %}
{{ pimcore_head_link() }}
{% endblock %}

Expand Down Expand Up @@ -132,7 +135,7 @@


{% if isPortal %}
{{ block('content') }}
{{ content }}
{% else %}
<div id="content" class="container">
<div class="row">
Expand All @@ -159,7 +162,7 @@
{{ pimcore_render_nav(breadbrumbs, 'breadcrumbs') }}
</div>
{% endif %}
{{ block('content') }}
{{ content }}
</div>

{% if leftNavShow %}
Expand Down
Loading