Opened 5 years ago

Closed 4 years ago

#26402 closed New feature (fixed)

Allow relative paths in {% extends %} and {% include %}

Reported by: Vitaly Bogomolov Owned by: Vitaly Bogomolov
Component: Template system Version: master
Severity: Normal Keywords: extends, include, template, relative path
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Allow relative paths in argument of 'extends' and 'include' template tags. Relative path must start from "./". Examples:

Extend "base.html", located in the same folder, where your template placed:

{% extends "./base.html" %}

Extend "base.html", located at two levels higher

{% extends "./../../base.html" %}

Extend "base.html", located in the 'dir1' subfolder, relatively current template:

{% extends "./dir1/base.html" %}

Discussion:
https://groups.google.com/d/topic/django-developers/rDAJ0Ig6FoU/discussion

Change History (8)

comment:1 Changed 5 years ago by Vitaly Bogomolov

Owner: changed from nobody to Vitaly Bogomolov
Status: newassigned

comment:2 Changed 5 years ago by Vitaly Bogomolov

Needs documentation: set

comment:3 Changed 5 years ago by Tim Graham

Triage Stage: UnreviewedSomeday/Maybe

The mailing list hasn't reach a consensus about whether or not to add this feature yet.

PR

comment:4 Changed 5 years ago by Tim Graham

Needs documentation: unset
Patch needs improvement: set
Triage Stage: Someday/MaybeAccepted

comment:5 Changed 4 years ago by Tim Graham

Patch needs improvement: unset
Summary: relative path in {% extends "./../base.html" %}Allow relative paths in {% extends %} and {% include %}

comment:6 Changed 4 years ago by Tim Graham

Patch needs improvement: set

A few comments for improvement remain and the branch needs to be rebased. Please uncheck "Patch needs improvement" after updating so the ticket returns to the review queue.

comment:7 Changed 4 years ago by Vitaly Bogomolov

Patch needs improvement: unset

comment:8 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In aec4f97:

Fixed #26402 -- Added relative path support in include/extends template tags.

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