Using block.super with multi-level inheritance
svanimpe opened this issue · 2 comments
svanimpe commented
From template-base.stencil
:
{% block additional-head %}{% endblock %}
From template-main.stencil
:
{% extends "template-base.stencil" %}
{% block additional-head %}
(some additional CSS styles)
{% endblock %}
From page.stencil
:
{% extends "template-main.stencil" %}
{% block additional-head %}
{{ block.super }}
(even more CSS styles)
{% endblock %}
Here block.super
does not include anything. It's as if it includes the content from template-base.stencil
instead of its immediate parent template-main.stencil
. I have used block.super
before, but never with multiple levels of inheritance.
Is this a bug, or is this simply not supported?
svanimpe commented
What exactly does this fix do? Should my example code now work, or is this not the right way of achieving this result?
ilyapuchka commented
It should fix the issue you described, now when doing {{ block.super }}
you should get the block of template you extend, before that base template was always used due to some implementation details.