mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #20995 -- Added support for iterables of template names to {% include %} template tag.
Thanks Adam Johnson for the review.
This commit is contained in:
parent
8690878507
commit
f37d548ede
4 changed files with 37 additions and 3 deletions
|
@ -688,6 +688,10 @@ the variable ``template_name``::
|
|||
The variable may also be any object with a ``render()`` method that accepts a
|
||||
context. This allows you to reference a compiled ``Template`` in your context.
|
||||
|
||||
Additionally, the variable may be an iterable of template names, in which case
|
||||
the first that can be loaded will be used, as per
|
||||
:func:`~django.template.loader.select_template`.
|
||||
|
||||
An included template is rendered within the context of the template that
|
||||
includes it. This example produces the output ``"Hello, John!"``:
|
||||
|
||||
|
@ -724,6 +728,10 @@ available to the included template::
|
|||
been evaluated and rendered* - not blocks that can be overridden by, for
|
||||
example, an extending template.
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
|
||||
Support for iterables of template names was added.
|
||||
|
||||
.. templatetag:: load
|
||||
|
||||
``load``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue