Opened 9 years ago

Closed 9 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: dev
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 by Vitaly Bogomolov, 9 years ago

Owner: changed from nobody to Vitaly Bogomolov
Status: newassigned

comment:2 by Vitaly Bogomolov, 9 years ago

Needs documentation: set

comment:3 by Tim Graham, 9 years ago

Triage Stage: UnreviewedSomeday/Maybe

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

PR

comment:4 by Tim Graham, 9 years ago

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

comment:5 by Tim Graham, 9 years ago

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

comment:6 by Tim Graham, 9 years ago

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 by Vitaly Bogomolov, 9 years ago

Patch needs improvement: unset

comment:8 by Tim Graham <timograham@…>, 9 years ago

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