Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1513 closed enhancement (invalid)

Multiple references to the same block is prohibited

Reported by: boris@… 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: UI/UX:


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:

<title>My Application: {% block title %}{% endblock %}</title>
<h1>{% block title %}{% endblock %}</h1>

Change History (2)

comment:1 Changed 12 years ago by boris@…

Resolution: invalid
Status: newclosed

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.

comment:2 Changed 12 years ago by Adrian Holovaty

milestone: Version 0.91

Milestone Version 0.91 deleted

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