Opened 4 years ago
Closed 4 years ago
#33291 closed New feature (wontfix)
Allow blocks with same name in if/else
| Reported by: | Ahmed Saoudi | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | 3.2 |
| Severity: | Normal | Keywords: | template, block |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Apparently, the Django template system doesn't allow for a block to appear more than once even within an if/else conditional, even if this means that, practically, the block will appear only once:
{% if condition %}
{% block title %}title with {{ variable }}{% endblock %}
{% else %}
{% block title %}static title{% endblock %}
{% endif %}
Allowing the block to appear more than once in such a setting may, IMHO; render things way more simple to handle.
Change History (1)
comment:1 by , 4 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
| Type: | Bug → New feature |
Note:
See TracTickets
for help on using tickets.
Thanks for this ticket, however this limitation is documented:
Moreover, this was already discussed on the mailing list. See related tickets closed as "wontfix": #20219, #24232, and #4529.