Opened 5 years ago

Closed 5 years ago

#13745 closed (wontfix)

Make extends allow select from multiple templates for themes fallback

Reported by: gauss 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: UI/UX:

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

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by gauss

Changed 5 years ago by gauss

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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