mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #26402 -- Added relative path support in include/extends template tags.
This commit is contained in:
parent
ad403ffa45
commit
aec4f97555
20 changed files with 206 additions and 0 deletions
|
@ -212,6 +212,26 @@ This tag can be used in two ways:
|
|||
|
||||
See :ref:`template-inheritance` for more information.
|
||||
|
||||
A string argument may be a relative path starting with ``./`` or ``../``. For
|
||||
example, assume the following directory structure::
|
||||
|
||||
dir1/
|
||||
template.html
|
||||
base2.html
|
||||
my/
|
||||
base3.html
|
||||
base1.html
|
||||
|
||||
In ``template.html``, the following paths would be valid::
|
||||
|
||||
{% extends "./base2.html" %}
|
||||
{% extends "../base1.html" %}
|
||||
{% extends "./my/base3.html" %}
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
The ability to use relative paths was added.
|
||||
|
||||
.. templatetag:: filter
|
||||
|
||||
``filter``
|
||||
|
@ -663,6 +683,13 @@ This example includes the contents of the template ``"foo/bar.html"``::
|
|||
|
||||
{% include "foo/bar.html" %}
|
||||
|
||||
A string argument may be a relative path starting with ``./`` or ``../`` as
|
||||
described in the :ttag:`extends` tag.
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
The ability to use a relative path was added.
|
||||
|
||||
This example includes the contents of the template whose name is contained in
|
||||
the variable ``template_name``::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue