Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1513 closed enhancement (invalid)

Multiple references to the same block is prohibited

Reported by: boris@… Owned by: adrian
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 10 years ago by boris@…

  • Resolution set to invalid
  • Status changed from new to closed

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 10 years ago by adrian

  • milestone Version 0.91 deleted

Milestone Version 0.91 deleted

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