Closed kluplau closed 6 years ago
@zimmen Can you help me with this one?
What happens when you remove the embed (or use include instead of embed)
I used the original poster's code and had the same issue. I switched
{% embed "sidebar.twig" %}{% endembed %}
to
{% include "sidebar.twig" %}
and it worked correctly for me.
I had a similar issue.
Code structure that happens the problem below:
{% block stylesheets %}
{{ parent() }}
<link href="{{ paths.css }}pages/account.css" rel="stylesheet">
{% endblock %}
{% block content %}
<div class="container">
{% embed 'layouts/l-grid-3-9.twig' %}
{% block sidebar_content %}
sidebar content
{% endblock %}
{% block body_content %}
body content
{% endblock %}
{% endembed %}
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% include 'block/account/b-javascripts.twig' %}
{% endblock %}
What happens?
The content after the parent() function in stylesheets block returns empty. It works when placing the stylesheets block after content block.
I decided to do a test putting the stylesheet block after the content block when I realized that the javascripts block was not returning empty.
I switched for:
{% block content %}
<div class="container">
{% embed 'layouts/l-grid-3-9.twig' %}
{% block sidebar_content %}
sidebar content
{% endblock %}
{% block body_content %}
body content
{% endblock %}
{% endembed %}
</div>
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link href="{{ paths.css }}pages/account.css" rel="stylesheet">
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% include 'block/account/b-javascripts.twig' %}
{% endblock %}
@Blueblau this sounds like a twig.js issue. Are you still having the problem? twig.js has some open "embed" issues - those might be useful, or you might be able to add to them
Hi
Thank you for an awesome plugin.
I have this issue, where when I embed a .twig-file, the "block page" returns empty. When I delete the embed the "block page" returns the page content.
Layout
Index.twig
Menu.twig