I'm trying to embed the sidebar and define which blocks to display.
{% embed "_partials/sidebar" %}
{% block instagram %}{% endblock %}
{% block subscribe %}{% endblock %}
{% endembed %}
sidebar.html is
{% block subscribe %}
block content
{% endblock %}
But it doesn't show anything and no errors as well (dev mode enabled).
The idea is make a dynamic sidebar and define which widgets I'd like to see in each template.
This is what I use right now.
{% set widgets = {
'about' : true,
'instagram' : true,
'menu' : false,
'recipes' : true,
'subscribe' : true
} %}
{% include "_partials/sidebar" with {
widgets: widgets
} %}
sidebar.html
{% if widgets.menu == 'true' %}
content
{% endif %}
is there any other more flexible approaches for this?
embed
. It's a strange tag... I useextends
andinclude
100% of the time.