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

Using block.super with multi-level inheritance #139

Closed
svanimpe opened this issue Sep 19, 2017 · 2 comments
Closed

Using block.super with multi-level inheritance #139

svanimpe opened this issue Sep 19, 2017 · 2 comments

Comments

@svanimpe
Copy link
Member

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
Copy link
Member Author

What exactly does this fix do? Should my example code now work, or is this not the right way of achieving this result?

@ilyapuchka
Copy link
Collaborator

ilyapuchka commented Nov 30, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants