Opened 9 years ago

Closed 9 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: master
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


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 9 years ago.
template_extends_select_multi.2.diff (946 bytes) - added by Andrey Gusev 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Andrey Gusev

Changed 9 years ago by Andrey Gusev

comment:1 Changed 9 years ago by Russell Keith-Magee

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