Opened 16 years ago
Closed 16 years ago
#11242 closed (duplicate)
templates: block tag can be nested in if but not in ifequal
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Template system | Version: | dev |
| Severity: | Keywords: | template, block, if, ifequal | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
(Applies to revision 10865)
Sometimes when template B extends template A, it can't redefine block contents.
The following does not work ('bbb' is displayed or nothing, depending on a and b)
- a.html
{% ifequal a b %} {% block X %} zzz {% endblock %} {% endif %}
- b.html
{% extends "a.html" %} {% block X %} bbb {% endblock %}
While this does (ifequal replaced with if):
- a.html
{% if a %} {% block X %} zzz {% endblock %} {% endif %}
- b.html
{% extends "a.html" %} {% block X %} bbb {% endblock %}
Note:
See TracTickets
for help on using tickets.
This applies also to
1.1 pre-alpha SVN-9536, so it's not a recent regression. I have not checked other versions.