#8297 closed (wontfix)
Withblock template tag
| Reported by: | Julien Phalip | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Important note: This ticket can work only if #8296 gets checked in.
Currently there is the convenient {% with %} tag to create variables in templates. Unfortunately there is no built-in counterpart for blocks. The attached patch does just that, with the following suggested syntax:
{% withblock as myurl %}
{% url path.to.some_view arg1,arg2,name1=value1 %}
{% and as var %}
{% whatever %}
{% in %}
Click the link: <a href="{{ myurl }}">link</a>.
<p>{{ var }}</p>
{% endwithblock %}
Attachments (1)
Change History (3)
by , 17 years ago
| Attachment: | 8297.withblock.diff added |
|---|
comment:1 by , 17 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This syntax doesn't really stand a chance. It's fairly unreadable. Needs more design discussion before it can become a ticket and that can wait until after 1.0.