I would like to extend a django template which is used via the include 
macro. That is, I want to add additional output before or after what would 
otherwise be emitted.

With the normal {% block %} syntax, it's easy to use super to follow the 
template heirachy similar to __mro__ - but to my knowledge there isn't an 
equivalent for include().

For example, form.as_p() calls render() with a template (by default, 
django/forms/p.html). I want my application to modify this, so whenever 
p.html is rendered, it is wrapped by my application's supplied template. 
(As I want this to work for any form instance, I cannot just override the 
default template name)

Another example is 
say django/forms/templates/django/forms/widgets/number.html. It consists of 
a single include() statement pointint to input.html. I would like to 
override input.html, but in a way which eventually renders the original 
template, in addition to my application's template.

Any suggestions?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ab15060-2dcd-44a0-abe3-eaeed8015813n%40googlegroups.com.

Reply via email to