- The include tag now has a 'with' option to include to provide extra context
  vairables to the included template.

- The include tag now has an 'only' option to exclude the current context
  when rendering the included template.

- The with tag now accepts multiple variable assignments.

- The with, include and blocktrans tags now use a new keyword argument format
  for variable assignments (e.g. `{% with foo=1 bar=2 %}`).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Chris Beaven 2010-12-18 02:50:26 +00:00
parent 99742d8d73
commit 3ae9117c46
8 changed files with 274 additions and 83 deletions

View file

@ -371,12 +371,11 @@ using the :ttag:`include` tag to reuse it in other templates::
{% endfor %}
If the form object passed to a template has a different name within the
context, you can alias it using the :ttag:`with` tag::
context, you can alias it using the ``with`` argument of the :ttag:`include`
tag::
<form action="/comments/add/" method="post">
{% with comment_form as form %}
{% include "form_snippet.html" %}
{% endwith %}
{% include "form_snippet.html" with form=comment_form %}
<p><input type="submit" value="Submit comment" /></p>
</form>