[EMAIL PROTECTED] wrote:
I was wondering, in response to more complex templating setups. If as a
user, you wanted to subclass a parent template, but the parent template
needs to dynamically generate content given a data source. An example
could be a calendar of events that you want displayed on every page.
The child page should not have to get those events and pass it to the
renderer. Is there some convention that Django follows, and if not,
what seems to be the most practical way for people who have dealt with
this?
Apart of template tags that Julio suggested you can use 'context
processors'. Those are custom functions executed for each response that
add some data needed in all pages. The most obvious example is passing
reference to currently logged in user for each page.
The docs for context processors are here:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext