home / django_tickets / tickets

tickets: 6646

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
6646 2008-02-22 19:17:42 2014-08-31 19:32:56 2022-03-06 03:37:39.724551 Accepted closed Template system Bug Normal dev wontfix included template blocks are not being overridden by parent template. When including a template into a parent template, the child-template's blocks are not overridden by the parent. For example: base.html: {{{ {% if is_satchmo %} {% include "satchmo_base.html" %} {% else %} {% include "journal_base.html" %} {% endif %} }}} journal_base.html contains the following block: {{{ {% block content%}{% endblock %} }}} view_template.html extends base.html (with the context variable is_satchmo == False). view_template.html contains {% block content%}{% endblock %} which should filled with data from the view's context variable. If I rename journal_base.html to base.html - everything works fine - but when I use the version of base.html that relies on the include tag, {% block content %} doesn't get overridden. The documentation says that context vairables are available to included templates, so not being able to override blocks seems like a bug.   anonymous include, extends, block 0 1 0 0 1 0
Powered by Datasette · Queries took 0.968ms