Opened 11 years ago

Closed 11 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 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:

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>
...

Change History (2)

comment:1 Changed 11 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 10 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