Opened 17 years ago

Closed 17 years ago

#7321 closed (invalid)

Rendering of file in the {% include %} Tag in Template doesnt work if the block defined in the base template is not included in the final template being rendered

Reported by: ashutoshb@… Owned by: nobody
Component: Template system Version: dev
Severity: Keywords: Include Tag
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

http://dpaste.com/53430/ (Doesnt Work)

http://dpaste.com/53434/ (Works)

Doesnt Work (Show Me is NOT rendered in the page displayed)

base.html

<body>
{% block overwrite %}
{% endblock overwrite %}
</body>


file_to_be_included.html

{% block overwrite %}
<p>Show Me</p>
{% endblock %}


file_rendered_to_response.html

{% extends base.html %}

{% include 'file_to_be_included.html' %}


Works (Show Me is Rendered in the page displayed)

base.html

<body>
{% block overwrite %}
{% endblock %}
</body>


file_to_be_included.html

<p>Show Me</p>


file_rendered_to_response.html

{% extends base.html %}
{% block overwrite %}
{% include 'file_to_be_included.html' %}
{% endblock %}

Change History (1)

comment:1 by Matt McClanahan, 17 years ago

Resolution: invalid
Status: newclosed

Everything a child template does has to be within a block which was defined in the parent template. So it's expected that an {% include %} from a child parent which is not inside a block won't work.

Note: See TracTickets for help on using tickets.
Back to Top