Code

Changes between Version 1 and Version 2 of ExtendingTemplates


Ignore:
Timestamp:
01/09/13 08:30:53 (15 months ago)
Author:
speidel@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExtendingTemplates

    v1 v2  
    4141 
    4242The trick is very simple - we add a new directory right at the end of TEMPLATE_DIRS which is the parent of all of the other directories. This has the effect of making every template file within our system uniquely addressable. Most of the time we will use the normal paths, but in the special case of wanting to extend a template with an over-riding version of itself we can reference its parent's full, unambiguous template path in the extends tag. 
     43 
     44 
     45An alternative approach without using the parent directory trick: http://github.com/stephenmcd/django-overextends