Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#8297 closed (wontfix)

Withblock template tag

Reported by: julien Owned by: nobody
Component: Template system Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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 arg1,arg2,name1=value1 %}
{% and as var %}
   {% whatever %}
{% in %}
   Click the link: <a href="{{ myurl }}">link</a>.
   <p>{{ var }}</p> 
{% endwithblock %}

Attachments (1)

8297.withblock.diff (2.0 KB) - added by julien 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by julien

comment:1 Changed 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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.

comment:2 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

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