Opened 14 years ago

Closed 14 years ago

#13745 closed (wontfix)

Make extends allow select from multiple templates for themes fallback

Reported by: Andrey Gusev Owned by: nobody
Component: Template system Version: dev
Severity: Keywords: extends multiple select list
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Attached patch allows us to easy make "multiple themed" site with fallback to default theme if current doesn't have requested template. Unit tests OK.

Example code:

cw = RequestContext(request, {
    'base_template': [ 'mytheme/b.html', 'default/b.html' ]
})
res = Template("""
{% extends base_template %}
{% block abc %}some content{% endblock %}
{% block content %}some other content{% endblock %}'
""", cw)

Attachments (2)

template_extends_select_multi.diff (952 bytes ) - added by Andrey Gusev 14 years ago.
template_extends_select_multi.2.diff (946 bytes ) - added by Andrey Gusev 14 years ago.

Download all attachments as: .zip

Change History (3)

by Andrey Gusev, 14 years ago

by Andrey Gusev, 14 years ago

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: wontfix
Status: newclosed

It strikes me that this is something that should be handled by a fallback in the template directories, not in the template/context itself. This is the way that the admin allows you to override admin base templates with local themes/customizations.

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