mirror of
https://github.com/django/django.git
synced 2025-03-28 18:20:49 +00:00
Fixed #21881 -- Clarify behavior of {% ssi %} template tag.
When using the `parsed` option, {% ssi %} has the same limitation as {% include %}, namely that the rendering of the included template is done separately. Thanks to trac user nagyv for the report and to alextreme for the patch.
This commit is contained in:
parent
202bf69c2f
commit
072fb923e1
@ -957,7 +957,7 @@ current page::
|
|||||||
The first parameter of ``ssi`` can be a quoted literal or any other context
|
The first parameter of ``ssi`` can be a quoted literal or any other context
|
||||||
variable.
|
variable.
|
||||||
|
|
||||||
If the optional "parsed" parameter is given, the contents of the included
|
If the optional ``parsed`` parameter is given, the contents of the included
|
||||||
file are evaluated as template code, within the current context::
|
file are evaluated as template code, within the current context::
|
||||||
|
|
||||||
{% ssi '/home/html/ljworld.com/includes/right_generic.html' parsed %}
|
{% ssi '/home/html/ljworld.com/includes/right_generic.html' parsed %}
|
||||||
@ -966,6 +966,13 @@ Note that if you use ``{% ssi %}``, you'll need to define
|
|||||||
:setting:`ALLOWED_INCLUDE_ROOTS` in your Django settings, as a security
|
:setting:`ALLOWED_INCLUDE_ROOTS` in your Django settings, as a security
|
||||||
measure.
|
measure.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
With the :ttag:`ssi` tag and the ``parsed`` parameter
|
||||||
|
there is no shared state between files -- each include is a completely
|
||||||
|
independent rendering process. This means it's not possible for example to
|
||||||
|
define blocks or alter the context in the current page using the included
|
||||||
|
file.
|
||||||
|
|
||||||
See also: :ttag:`{% include %}<include>`.
|
See also: :ttag:`{% include %}<include>`.
|
||||||
|
|
||||||
.. templatetag:: templatetag
|
.. templatetag:: templatetag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user