Opened 19 years ago

Closed 19 years ago

Last modified 18 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: 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>
...

Change History (2)

comment:1 by boris@…, 19 years ago

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 by Adrian Holovaty, 18 years ago

milestone: Version 0.91

Milestone Version 0.91 deleted

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