#1513 closed enhancement (invalid)
Multiple references to the same block is prohibited
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | 0.91 |
Severity: | minor | Keywords: | block template |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Attempting to refer to the same block twice in a template causes a TemplateSyntaxError to be thrown. This seems like a useful and harmless thing to do, unless I'm missing something. (I realize that some thought has probably gone into this, so maybe just an explanation would do. Searching the docs proved fruitless.)
Here's a typical example that comes to mind:
... <head> <title>My Application: {% block title %}{% endblock %}</title> </head> <h1>{% block title %}{% endblock %}</h1> ...
Note:
See TracTickets
for help on using tickets.
Sorry... I rushed to a conclusion. Now I realize what the following means:
Finally, note that you can't define multiple {% block %} tags with the same name in the same template. This limitation exists because a block tag works in "both" directions.