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

Already on GitHub? Sign in to your account

Cannot override blocks in included templates #169

Closed
dwt opened this Issue Jan 8, 2013 · 2 comments

Comments

Projects
None yet
3 participants

dwt commented Jan 8, 2013

We're trying to override a block in an included template like this:

#included.jinja2

{% block master %}
    Default master content
{% endblock %}
#base.jinja2
{% include "included.jinja2" %}
{% include "included.jinja2" with context %}

{% block master %}
Fnord
{% endblock master %}
#hello.jinja2
{% extends "base.jinja2" %}

{% block master %}

Overridden master content

{% endblock master %}

When running the hello.jinja2 file we see this output

    Default master content
    Default master content
Overridden master content

I would have expected at least the second default master content to be replaced by the overriden content.

That I think is the bug.

@mitsuhiko mitsuhiko closed this May 20, 2013

Owner

mitsuhiko commented May 20, 2013

Duplicate.

rbu commented May 28, 2013

of?

@camerongray1515 camerongray1515 added a commit to camerongray1515/Chaac that referenced this issue Jun 6, 2015

@camerongray1515 camerongray1515 Moved brand navbar into base.html - The title could not be changed fr…
…om templates extending base.html when it was in the included file. See: pallets/jinja#169
af5b6ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment